JMSException InterruptedIOException - the producer thread get interrupted
Asked Answered
H

2

6

I am getting JMS Exception and it seems queue does not exit or it's not finishing the task.

Messages are asynchronous and it work fine most of the time but sometimes get below exception. It seems listener is keep listening at other side but at producer side got this exception.

javax.jms.JMSException: java.io.InterruptedIOException
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1266)
at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1350)
at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:495)
at com.vtech.mqservice.response.SendResponse.sendResponseToQueue(SendResponse.java:44)


Caused by: java.io.InterruptedIOException
at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:102)
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40)
at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:74)
at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:79)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1244)
... 0 more

Please help me to identify what causes the producer thread to get interrupted.

I'll upgrade activemq version to latest and will update the findings.

Please point me in the right direction?

Update : ActiveMQ version being used is activemq-all-5.3.0.jar

Hathcock answered 10/8, 2015 at 19:33 Comment(0)
T
1

I googled your exception got no precise answer, but then I went through the source code for WireFormatNegotiator of ActiveMQ.

You can find here, http://alvinalexander.com/java/jwarehouse/activemq/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java.shtml

public void oneway(Object command) throws IOException {
    try {
        if (!readyCountDownLatch.await(negotiateTimeout, TimeUnit.MILLISECONDS)) {
            throw new IOException("Wire format negotiation timeout: peer did not send his wire format.");
        }
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new InterruptedIOException();
    }
    super.oneway(command);
}

I think your problem is somehow about "negotiateTimeout". Maybe you should set a certain amount of timeout or remove it if you put it before.

Theadora answered 29/9, 2015 at 21:2 Comment(0)
H
0

I got the same exception and figured out that JVM MaxPermSize is low. I increased the size to 1024Mb and it worked.

Handal answered 11/10, 2017 at 7:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.