I'm running a few integration tests with Qpid (qpid setup based on the answer to this previous question. The application is a Spring Integration flow, receives an incoming message and processes. The test will receive the messages, process, and then check assertions on the outcome of the process.
I managed to start the java broker in the @Before
method of the test, and the test will run correctly, but when the test finishes, the broker shuts down on @After
, and then (on the client side I think, but I'm not sure), instead of wrapping up, new instances of org.apache.qpid.client.AMQSession.Dispatcher
are created, and they end up in an endless loop instead of closing.
[2016-05-20 17:29:28,457][DEBUG][org.springframework.jms.listener.DefaultMessageListenerContainer#0-2][org.apache.qpid.client.AMQSession.Dispatcher] - Dispatcher-2-Conn-2 created
[2016-05-20 17:29:28,457][DEBUG][Dispatcher-2-Conn-2][org.apache.qpid.client.AMQSession.Dispatcher] - Dispatcher-2-Conn-2 started
Then Dispatcher-2-Conn-2 will run forever in a loop without ending. Spring is using a org.apache.qpid.client.PooledConnectionFactory
as argument for a spring JmsTemplate for sending the messages.
So my questions are:
- Anybody have any experience with qpid java broker + junit? (beyond the link below) to highlight anything that would be glaringly obvious that I'm missing from the setup/teardown.
- I think the rebel threads are on the client side rather than the broker. How would one get hold of all sessions/connections/etc created by Spring to properly terminate them?
- Would killing the vm stop a jenkins build that has this test? :D
(The tests used to run correctly with ActiveMQ, and with far less configuration and setup, but we've been told to move away from ActiveMQ so here we are).