PHPackages                             trainjunkies-packages/data-feeds-queue-subscriber - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. trainjunkies-packages/data-feeds-queue-subscriber

ActiveLibrary[Queues &amp; Workers](/categories/queues)

trainjunkies-packages/data-feeds-queue-subscriber
=================================================

Subscribe to Network Rail &amp; National Rail data feed queues

v6.1(2y ago)19[1 PRs](https://github.com/thirdrailuk/data-feeds-queue-subscriber/pulls)MITPHPPHP ^7.4.24CI failing

Since Feb 11Pushed 7mo agoCompare

[ Source](https://github.com/thirdrailuk/data-feeds-queue-subscriber)[ Packagist](https://packagist.org/packages/trainjunkies-packages/data-feeds-queue-subscriber)[ RSS](/packages/trainjunkies-packages-data-feeds-queue-subscriber/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (7)Versions (9)Used By (0)

The Third Rail - Data Feeds Queue Subscriber
============================================

[](#the-third-rail---data-feeds-queue-subscriber)

[![CI](https://github.com/third-rail-packages/data-feeds-queue-subscriber/workflows/CI/badge.svg)](https://github.com/third-rail-packages/data-feeds-queue-subscriber/workflows/CI/badge.svg)

PHP package to consume Open Rail Data feeds from National Rail &amp; Network Rail via Active MQ STOMP. Supports durable connections with server heartbeats.

Installation
------------

[](#installation)

### via Composer

[](#via-composer)

Install [Composer](https://getcomposer.org/doc/00-intro.md) and require the package with the below command.

```
composer require third-rail-packages/data-feeds-queue-subscriber
```

Getting Started
---------------

[](#getting-started)

### National Rail - DARWIN PushPort

[](#national-rail---darwin-pushport)

Signup to the [National Rail Open Data feeds](https://opendata.nationalrail.co.uk/) to generate your unique credentials. More information can be found on the [Open Rail Data Wiki](https://wiki.openraildata.com/index.php?title=Darwin:Push_Port#Usage).

`./scripts/national-rail`

### Network Rail - NROD, TRUST, TD

[](#network-rail---nrod-trust-td)

Signup to the [Network Rail Open Data platform](https://datafeeds.networkrail.co.uk/) to generate a username and password for the feeds. Be sure to activate the Active MQ topics you wish to subscribe to. More information can be found on the [Open Rail Data Wiki](https://wiki.openraildata.com/index.php?title=About_the_Network_Rail_feeds#How_do_I_get_the_data.3F)

Example code can be found in `./scripts/network-rail`

### Durable Subscription with heartbeats

[](#durable-subscription-with-heartbeats)

Below example with request a durable connection with supplied Client ID and ActiveMQ subscription name expecting a heartbeat frame from the server every 20 seconds while emitting one every 5.

```
