I have a erratic problem with Java JMS.
For moments works fine, but throws the following exception erratically and cut the execution.
It is important to note that this occurs without stopping the broker.
javax.jms.JMSException: Peer (vm://test#1) disposed.
Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://test#1) disposed.
I think it could be this issue with ActiveMQ: https://issues.apache.org/jira/browse/AMQ-2902
This issue tracker thread says that it is harmless (it is just a noisy INFO level log message), and that it is fixed in ActiveMQ 5.4.2.
On the other hand, you say that the exception "cut the execution" ... which could mean that this is a different issue to yours ...
Anyone getting a "peer disposed" exception that isn't fixed by upgrading ActiveMQ, and isn't related to shutdown (see Unable to shutdown embedded activeMQ service using the built in BrokerService.stop call) should consider lodging a bug report.