Difference between revisions of "Darwin:Push Port"

From Open Rail Data Wiki
Jump to navigation Jump to search
Line 63: Line 63:
 
The Push Port feeds are accessed through the [http://en.wikipedia.org/wiki/Streaming_Text_Oriented_Messaging_Protocol STOMP protocol] from the National Rail [http://activemq.apache.org ActiveMQ message server].  A STOMP client subscribes to a queue that is unique to each registered user, and is then sent messages via the queue.  You will need a STOMP client (available in most languages - a list is available [http://stomp.github.io/implementations.html here]) or an [http://activemq.apache.org/openwire.html OpenWire client].  The Push Port messages are compressed using gzip, then queued and sent to any connected subscribers.
 
The Push Port feeds are accessed through the [http://en.wikipedia.org/wiki/Streaming_Text_Oriented_Messaging_Protocol STOMP protocol] from the National Rail [http://activemq.apache.org ActiveMQ message server].  A STOMP client subscribes to a queue that is unique to each registered user, and is then sent messages via the queue.  You will need a STOMP client (available in most languages - a list is available [http://stomp.github.io/implementations.html here]) or an [http://activemq.apache.org/openwire.html OpenWire client].  The Push Port messages are compressed using gzip, then queued and sent to any connected subscribers.
  
Real-time feeds can be made durable, so messages are not lost if a client experiences a brief disconnection.  See the page on [[Durable_Subscription|durable subscriptions]] and the code examples below for more information.
+
Real-time feeds can be made durable, so messages are not lost if a client experiences a brief disconnection.  See the page on [[Durable_Subscription|durable subscriptions]] and the code examples below for more information. Each user's queue maintains 5 minutes worth of Push Port messages.
  
Each user's queue maintains 5 minutes worth of Push Port messages.
+
Please note that once you have registered for an account, if you leave your message queue idle (i.e. you do not connect your STOMP client to pull data down) for an extended period, your account and queue will be deleted. The unused account expiry period is currently set to 30 days. If your account has been deleted, you will receive a notification email, and you will be able to re-register for a new account at [https://datafeeds.nationalrail.co.uk/darwin/index.html#/filter datafeeds.nationalrail.co.uk]
  
 
== Accessing the Darwin timetable, reference data, and snapshot files ==
 
== Accessing the Darwin timetable, reference data, and snapshot files ==

Revision as of 15:02, 6 March 2015

About

The Darwin Push Port is an XML push feed that continuously streams information about the creation of, and changes to, train schedule records, together with train running predictions made by Darwin.

The Push Port can be filtered to a specific area of interest by TIPLOC, or to provide information for the entire country. Either way, the information delivered is complex and must be properly interpreted before presentation to end users.

The Push Port requires the user to build a database capable of capturing extremely high volumes of information, as well as a query engine to draw the information from your database. There is a large amount of interpretation work involved in this; however this allows substantial flexibility to apply the information to any product within the limitations of your own infrastructure.

Availability

The Darwin Push Port feed is expected to be available by 31st March 2015.

Data

The Push Port has three components:

  • Reference Data, available over FTP once a day
  • Timetable, available over FTP once a day
  • Real-time updates, available over Stomp

XSDs for the interface are available.


Reference Data

The reference data contains:

  • TIPLOCs, CRS codes, TOC codes and location names
  • TOC codes, names and website URLs
  • Late Running reason codes and text
  • Cancellation reason codes and text
  • Via locations
  • CIS codes and names

Timetable

There are two components to the Darwin Timetable:

  • A timetable snapshot, available once a day via FTP
  • Schedule updates via the Real-time feed (see below)

Real-time Updates

NOTE: All messages in the real-time update stream are sent in XML with the message body compressed using gzip.

Each message in the update feed contains update response element, which is in turn nested inside a 'Pport' element:

How do I get the data?

To access the data feeds you must register for an account at [1]. Once you have submitted the registration form, you should receive a confirmation email. Follow the instructions in the email and set your new password.

Once you have set your password and signed in, navigate to the data feeds screen by clicking on the My Feeds link at the top of the page On this screen you can find your personal queue name along with the username and password required to connect to the message queue, as well as the FTP site details and credentials.

Accessing the data feeds

The Push Port feeds are accessed through the STOMP protocol from the National Rail ActiveMQ message server. A STOMP client subscribes to a queue that is unique to each registered user, and is then sent messages via the queue. You will need a STOMP client (available in most languages - a list is available here) or an OpenWire client. The Push Port messages are compressed using gzip, then queued and sent to any connected subscribers.

Real-time feeds can be made durable, so messages are not lost if a client experiences a brief disconnection. See the page on durable subscriptions and the code examples below for more information. Each user's queue maintains 5 minutes worth of Push Port messages.

Please note that once you have registered for an account, if you leave your message queue idle (i.e. you do not connect your STOMP client to pull data down) for an extended period, your account and queue will be deleted. The unused account expiry period is currently set to 30 days. If your account has been deleted, you will receive a notification email, and you will be able to re-register for a new account at datafeeds.nationalrail.co.uk

Accessing the Darwin timetable, reference data, and snapshot files

Darwin releases the timetable and reference data file once a day. These files along with a snapshot file that is taken shortly after the timetable has been downloaded are made available for download via an FTP site. All Push Port messages that are older than 5 minutes are also placed in this FTP site in log files, with each log file containing 5 minutes of Push Port messages. It should be noted that the messages in the log files in the FTP site are not compressed.

The FTP site's URL and access credentials are displayed in the My Feeds screen.

Good Practice

Read about good practice when using this service here.

Examples

Code examples for STOMP clients are available in Github.

The advanced usage page contains examples of some advanced applications for the data feeds, including bridging the ActiveMQ feeds to your own messaging server.

Support

If you are having problems with the feeds:

  • First, read this wiki - there's a lot of material here that will help you
  • If you want to discuss your problem with other people working with the service, the openraildata-talk group on Google Groups will be useful
  • Finally, if you're still having a problem, email darwind3.support@rockshore.net