Difference between revisions of "Darwin:Push Port"

From Open Rail Data Wiki
Jump to navigation Jump to search
(Add twitter url)
Line 15: Line 15:
 
* Real-time updates, available over Stomp and historically, in-day, via FTP
 
* Real-time updates, available over Stomp and historically, in-day, via FTP
  
[[Darwin:Push_Port_XML_Schemas|XSDs]] for the interface are available.
+
[[Darwin:Push_Port_XML_Schemas|XSDs]] for the interface are available, along with the [[Media:Push_Port_Interface_Specification.gz|specification]].
  
 
== Reference Data ==
 
== Reference Data ==

Revision as of 08:18, 28 October 2016

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.

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 and historically, in-day, via FTP

XSDs for the interface are available, along with the specification.

Reference Data

The reference data contains:

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 http://datafeeds.nationalrail.co.uk. 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. You will find your queue name, username and password, as well as details of the username and password you should use to download data from the FTP service.

Keep your queue name private, and do not let others know what it is.

Accessing real-time data

The data from the Push Port is available on datafeeds.nationalrail.co.uk via:

You will need a STOMP client (available in most languages - a list is available here) or an OpenWire client.

Messages bodies are compressed using gzip before being placed on per-user queues.

Each user's queue maintains 5 minutes worth of Push Port messages.

Important - Please note that once you have registered for an account, if you leave your message queue idle for an extended period, i.e. you do not connect your STOMP client to pull data down, your account and queue will be deleted. The unused account expiry period is currently set to 100 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.

Accessing non-real time data

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

You should follow the good practice guide when using this service.

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
  • Check twitter to see if an issue has been reported
  • 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