Santosh
Santosh

Reputation: 852

JMSException InterruptedIOException - the producer thread get interrupted

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

Upvotes: 6

Views: 3254

Answers (2)

sandy
sandy

Reputation: 21

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

Upvotes: 0

Afsin Buyuksarac
Afsin Buyuksarac

Reputation: 298

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.

Upvotes: 1

Related Questions