Using Ruby To Connect To Darwin Push Port

70 views
Skip to first unread message

John Dickinson

unread,
Nov 27, 2015, 4:11:36 PM11/27/15
to A gathering place for the Open Rail Data community
Hi
I am currently connecting to the Darwin Push Port queue using basic PHP and Stomp. However I don't believe its performing that well....ie it is not consuming the queue at busy times quickly enough (I believe). PHP is currently the only language I know.

Its led me to think whether I should try Ruby instead (Means learning a new language). I am running a Centos virtual server. I don't fancy trying the Activemq method as it looks very complicated.

Is Ruby a better language to consume the feeds compared to PHP? Can anyone give me any advice re starting out learning Ruby? In fact does anyone use Ruby to consume the feeds currently?

Any guidance greatly appreciated............

Thanks
John

Peter Mount

unread,
Nov 27, 2015, 4:16:07 PM11/27/15
to John Dickinson, openraildata-talk

I'm not certain about ruby as I've not used it myself although there are a clients for it: http://activemq.apache.org/ruby.html

Personally I'm using java but not the way that's in the wiki. I've got a simple client using the wire protocol rather than stomp. It keeps up well mainly as it's just a bridge to my RabbitMQ server so when things are busy or queues it up but even then it's rarely more than a few messages at a time.

Peter

--
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.

John Dickinson

unread,
Nov 27, 2015, 4:35:27 PM11/27/15
to A gathering place for the Open Rail Data community, jr2dic...@googlemail.com, pe...@retep.org.uk
Thanks for the feedback Peter. Must admit the Java wiki looked a bit tricky as well (I'm relatively new to programming...........). Ruby looked a little more straight forward. (Although I may be totally wrong!)
Regards
John

Peter Mount

unread,
Nov 27, 2015, 4:40:50 PM11/27/15
to John Dickinson, openraildata-talk

Well it can be simpler 😉

For example for the nre/darwin pushport feed here's my source:

https://github.com/peter-mount/opendata/tree/master/applications/nationalrail/src/main/java/uk/trainwatch/nre

Obviously I've got library code behind that but that's all there is. There's issues with it but it's stable. The nr equivalent is rock solid - don't know why the nre one has problems reconnecting when there's a problem.

John Dickinson

unread,
Nov 27, 2015, 4:59:03 PM11/27/15
to A gathering place for the Open Rail Data community, jr2dic...@googlemail.com, pe...@retep.org.uk
Thanks Peter. Its the Library code thats confusing me. I am guessing I need to install a bunch of things (including Java) but not sure where or how?

John Dickinson

unread,
Nov 28, 2015, 7:10:20 AM11/28/15
to A gathering place for the Open Rail Data community, jr2dic...@googlemail.com, pe...@retep.org.uk
Hi Peter. Have been researching around the net following your advice. It does look like Java is my best option. Thanks again for the link to your code and advice 
Reply all
Reply to author
Forward
0 new messages