durable connection issue

158 views
Skip to first unread message

Clint C

unread,
Mar 7, 2018, 6:11:57 AM3/7/18
to A gathering place for the Open Rail Data community
Hi there

i hope someone can help me.

i am trying to create a durable connection using PHP using the following code;

$channel = 'TRAIN_MVT_ALL_TOC';

$con = new Stomp($server, $user, $password, array('client-id' => 'ab4cd65743fa66se'));

$con->subscribe("/topic/".$channel ,array('activemq.subscriptionName'=>"ab4cd65743fa66se"));

i am getting error

Fatal error: Uncaught exception 'StompException' with message 'User is not authorized to create: topic://TRAIN_MVT_ALL_TOC'

Any advice would be helpful

Clint.

Clint C

unread,
Mar 7, 2018, 7:26:22 AM3/7/18
to A gathering place for the Open Rail Data community
i am using the username and password i use to access push port. Im guessing this is wrong? i am trying to make a durable connection to the live data.

i have created a separate account @ https://datafeeds.networkrail.co.uk/ntrod/ but is says im pending 473rd in queue?

Dom Rodriguez

unread,
Mar 7, 2018, 10:42:34 AM3/7/18
to Clint C, A gathering place for the Open Rail Data community
Hello Clint,

Darwin's Push Port feed and Network Rail's data feeds are two
different services. You will require credentials for them separately.

Network Rail's data feeds (NTROD/NROD) have a user limit of 500, last
time I checked, so you'll have to wait until you can be allocated a
"Active" status, conversely to a "Pending" status.

I add as well that the client-id parameter you supplied to Network
Rail should be the email address you signed up with, and
subscriptionName should be a unique string for each subscription
(IIRC). My Erlang application concatenates the first part of the
Erlang node's hostname and the queue name (without the "/topic/" part)
for the subscriptioName, if that helps.

Once you have access to Network Rail's data feeds, you should be able
to connect.

Apologies I could not be of any better news, I hope you get access soon.
--
Best regards,
Dom Rodriguez (shymega / dzr).

Peter Hicks

unread,
Mar 7, 2018, 10:55:54 AM3/7/18
to shy...@shymega.org.uk, Clint C, A gathering place for the Open Rail Data community
On Wed, 7 Mar 2018 at 15:42 Dom Rodriguez <shy...@shymega.org.uk> wrote:
 
Darwin's Push Port feed and Network Rail's data feeds are two
different services. You will require credentials for them separately.

Also, if you're using the National Rail (Darwin) feed, you'll need to subscribe to a queue rather than a topic.

But if you are just using the Network Rail feed and your account is still 'pending', you'll have to wait a while I'm afraid :(


Peter


OpenTrainTimes Ltd. registered in England and Wales, company no. 09504022.
Registered office: 13a Davenant Road, Upper Holloway, London N19 3NW

Clint C

unread,
Apr 5, 2018, 2:15:36 PM4/5/18
to A gathering place for the Open Rail Data community
Thanks Peter


is is possible to make a durable connection to Darwin rather than Network Rail?

Peter Hicks

unread,
Apr 5, 2018, 4:20:30 PM4/5/18
to Clint C, A gathering place for the Open Rail Data community
Hi Clint

No need - it's a message queue (versus a topic on Network Rail) already.


Peter

On Thu, 5 Apr 2018, 19:15 Clint C, <cl...@net-key.co.uk> wrote:
Thanks Peter


is is possible to make a durable connection to Darwin rather than Network Rail?

--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To post to this group, send email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Clint C

unread,
Apr 6, 2018, 4:03:57 AM4/6/18
to A gathering place for the Open Rail Data community
Hi Peter

i need some more explanation as to how the Darwin queue works.
Say my app makes a connection to the queue and then gets data on a cycle. Will it ever miss data during the cycles? Also what happens if the app closes and needs to be reopened? does it then miss data?

Peter Hicks

unread,
Apr 6, 2018, 3:17:28 PM4/6/18
to Clint C, A gathering place for the Open Rail Data community
Hi Clint

You don't need to connect periodically with a message queue or topic - you connect once and messages are received by your application and handled as they come in.

All messages are delivered even if your client is disconnected (as long as they haven't expired on the server) when using a queue.  When using a topic, you only get messages when you're connected unless you request a durable subscription, when the server let's one client connect with the client ID and subscription name you've specified.  Keep these the same across sessions and you'll be fine.  Change them and you'll get a new subscription.


Peter

Clint C

unread,
Apr 8, 2018, 5:09:32 AM4/8/18
to A gathering place for the Open Rail Data community
Thanks Peter

so im guessing that the server knows who you are via your queue name?

also what is the server time out before a queue expires on the server?

thanks again

Clint.

Clint C

unread,
Apr 17, 2018, 4:29:14 AM4/17/18
to A gathering place for the Open Rail Data community
Anyone know what is the server time out before a queue expires on the server for Darwin?


On Wednesday, 7 March 2018 11:11:57 UTC, Clint C wrote:

WantStuff

unread,
Apr 17, 2018, 11:57:09 AM4/17/18
to A gathering place for the Open Rail Data community
National Rail Queue - AKA Darwin:
I don’t think I have seen it officially documented but I suspect it is 5 minutes (sometimes longer based on my experiences).
Therefore as long as you reconnect within that time you should not loose any messages. If you are disconnected for longer you can use the PushPort*.log files to catch up.

Network Rail Topic - AKA NROD:
If you connect with a Durable subscription then the messages will be held for 5 minutes upon disconnection. If you are disconnected for longer or did not initially connect with a Durable subscription then the messages are lost.


Martin
Reply all
Reply to author
Forward
0 new messages