Test case for TorqueBox stomplet issue
This is a simple rails 3 app that has a single page. After loading the page, we send a message to the server. The server stomplet subscribes to a JMS topic. Messages from the client get echoed back to it via the topic.
If you run this in torquebox, you'll see a response from the server immediately. If you refresh the page a couple of times (it can be the first time, it may need to be done a couple of times), you'll then get no response from the server. After 5 seconds or so, you'll see the following in the TB console:
09:54:27,031 WARN [org.hornetq.core.client.impl.ClientConsumerImpl] (Thread-0 (HornetQ-client-global-threads-1782417818)) Timed out waiting for handler to complete processing
There is a button that will also send a message. If the first one is successful, this can be used to check everything is fine, and it will work fine. If the initial message failed to get a response, any further messages also fail to get through. You can see the message being logged in the stomplet, it seems to be the HornetQ topic that is not being listened to.
The key files are app/views/test/index.html.erb for the client side, and /app/models/work_stomplet for the server
The stomplet has debug statements to show the subscriber connecting and disconnecting properly.