I have written a windows service using the Apache.NMS and Apcahe.NMS.ActiveMQ (version 1.0) libraries. The service consumes messages from ActiveMQ from a vendor server.
The service spins up a connection and listens for messages (I handle the OnMessage event)
The connection is a transacted connection so I call commit after each message.
When the service starts up, everything works very well and does so for a while. However, after it has run for a while, it will no longer consume messages. Even if I reset the service. It usually takes a restart of my service AND the vendor server (tomcat) to get things going again. The vendor insists that nothing is wrong on their side.
No exceptions are thrown on either side (client or server) – it’s just ‘stuck’.
Should I consider using Spring.Messaging.Nms?
I have discovered the problem. After establishing the connection and the message listener the service went into a loop with Thread.Sleep(500). Dumb. I refactored the service to start everything up in OnStart and dispose of it in OnStop.
Since doing that, everything is running perfectly.
Classic ID-10-T error occurring between keyboard and chair.