Erratic javax.jms.JMSException: peer to peer

I have a problem with Java JMS. Works fine for moments, but throws the next exception and shortens the execution.

It is important to note that this happens without stopping the broker.

javax.jms.JMSException: Peer (vm://test#1) disposed. at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49) at org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1773) at org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1790) at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:99) at org.apache.activemq.transport.ResponseCorrelator.onException(ResponseCorrelator.java:114) at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:99) at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:203) at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122) at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://test#1) disposed. 
+4
source share
2 answers

I think this may be a problem with ActiveMQ: https://issues.apache.org/jira/browse/AMQ-2902

This thread for tracking this problem 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 โ€œshortens the executionโ€ ... which may mean that this is another problem for you ...

UPDATE

Anyone who receives a peer-to-peer exception that is not caught by the ActiveMQ update and is not disconnected (see Unable to disable the built-in activeMQ service using the built-in BrokerService.stop call ) should consider reporting an error.

+3
source

It would seem that the problem with the poster is completely different. The link refers to a noisy INFO level log message, but above (which is also what I get) is a thrown JMSException that has these additional lines from the Caused by: clause.

  at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:88) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68) at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60) at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1275) ... 31 more 

The odd part is checking connection.isClosed () before it closes. Thus, the connection is open, but the peer is still located. Exploring other potential answers online, the only possible solution is that the connection to the broker is intact, but the specific queue may be closed.

In my particular case, this happened when the broker was stopped, but consumers and manufacturers were still trying to make connections. Sometimes the connection was still considered open (i.e., not closed, even if the broker was stopped). Fixing this so that the broker would not die fixed my problem.

I also wanted to add that I saw this question in ActiveMQ 5.6 (but I did not test it in 5.8).

+1
source

All Articles