简体   繁体   English

JMSException InterruptedIOException - 生产者线程被中断

[英]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. 我正在获得JMS异常,似乎队列没有退出或者它没有完成任务。

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. 我将activemq版本升级到最新版本并将更新调查结果。

Please point me in the right direction? 请指出我正确的方向?

Update : ActiveMQ version being used is activemq-all-5.3.0.jar 更新:正在使用的ActiveMQ版本是activemq-all-5.3.0.jar

I googled your exception got no precise answer, but then I went through the source code for WireFormatNegotiator of ActiveMQ. 我用谷歌搜索你的异常得不到确切的答案,但后来我浏览了ActiveMQ的WireFormatNegotiator的源代码。

You can find here, http://alvinalexander.com/java/jwarehouse/activemq/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java.shtml 你可以在这里找到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". 我认为你的问题在某种程度上是关于“negotiateTimeout”。 Maybe you should set a certain amount of timeout or remove it if you put it before. 也许你应该设置一定量的超时或删除它,如果你之前。

I got the same exception and figured out that JVM MaxPermSize is low. 我得到了相同的异常,并发现JVM MaxPermSize很低。 I increased the size to 1024Mb and it worked. 我将大小增加到1024Mb并且工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM