Heartbeats configuration in Apache.NMS.Stomp Version 1.5.4.3215

172 views
Skip to first unread message

richie...@gmail.com

unread,
Jun 24, 2015, 8:31:20 AM6/24/15
to openrail...@googlegroups.com
Hi folks. I'm using c#.net to create a connection to the RTPPM feed. Each night, my consumer service stops receiving messages (12:00 or 02:00) always on the hour. At this point, the consumer service stops receiving messages and doesn't "wake up" when a new one arrives, so I have to restart the consumer service. I've seen that it's a good idea to implement heartbeats and durable connections, however I'm finding the documentation for NMSConnectionFactory confusing. Has anyone out there implemented heartbeats / durable connection using a NMSConnectionFactory?

My code (extract) at present is this ...

IConnectionFactory factory = new NMSConnectionFactory(new Uri(_mySettings.DataFeed));

...where _mySettings.DataFeed = "stomp:tcp://datafeeds.networkrail.co.uk:61618"

Thanks in advance for any guidance you can provide :-)
Cheers, Richie, York.

Michael Pritchard

unread,
Jun 24, 2015, 8:57:20 AM6/24/15
to richie...@gmail.com, openraildata-talk
once youve got an ISession there is a CreateDurableConsumer method.

There is some code in here, although it might be a bit confusing:


see the CreateConsumer method. The ActiveMQDurableSubscriberId" setting is just a unique string i made up that I think registers itself as the durable subscription id, so if you lose connection and reconnect with the same id it will resend the missed messages.

Heartbeats Im not sure about, but I run my application as a service that restarts on failure (e.g. due to connection drop out) so I'm not too bothered about that.


--
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 an email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--------------------------------------------------------------
Michael Pritchard
Web      :: http://www.blueghost.co.uk
GMail    :: blueg...@gmail.com
--------------------------------------------------------------

Chris Bailiss

unread,
Jun 25, 2015, 10:07:40 AM6/25/15
to openrail...@googlegroups.com
I don't think they are supported, judging by the available configuration options:
http://activemq.apache.org/nms/stomp-uri-configuration.html

However if anyone knows otherwise please correct me.

Chris

Geoff M

unread,
Mar 21, 2017, 9:39:12 PM3/21/17
to A gathering place for the Open Rail Data community

(21 months later)
I can't find any documentation on the heartbeats either (still), just a "die after n milliseconds of inactivity" setting which is not helpful. I'm not really keen on dropping and restarting the connection just because of inactivity - seems a bandaid fix rather than preventing it in the first place.

Specific exception is:
Apache.NMS.Stomp.IOException: Channel was inactive for too long: tcp://datafeeds.networkrail.co.uk:61618/

So, 21 months later, is there still no solution or do I have to write my own client to handle the heartbeats properly? Or is there another STOMP client I can use for .NET?

Thanks.
Reply all
Reply to author
Forward
0 new messages