2015-08-10 14 views
6

Ricevo l'eccezione JMS e sembra che la coda non esca o che non finisca l'operazione.JMSException InterruptedIOException - il thread del produttore viene interrotto

I messaggi sono asincroni e funzionano bene la maggior parte del tempo, ma a volte si trovano sotto l'eccezione. Sembra che l'ascoltatore continui ad ascoltare dall'altra parte, ma al lato produttore ha ottenuto questa eccezione.

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 per identificare ciò che provoca l'interruzione del thread del produttore.

Aggiornare la versione di Activemq alla più recente e aggiornerò i risultati.

Per favore, indicarmi la direzione giusta?

Aggiornamento: versione ActiveMQ in uso è activemq-all-5.3.0.jar

risposta

1

Ho cercato su google il tuo eccezione ottenne risposta precisa, ma poi ho attraversato il codice sorgente di WireFormatNegotiator di ActiveMQ.

Potete trovare qui, 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); 
} 

Credo che il problema è in qualche modo di "negotiateTimeout". Forse dovresti impostare una certa quantità di timeout o rimuoverla se la metti prima.

0

Ho ottenuto la stessa eccezione e ho capito che JVM MaxPermSize è basso. Ho aumentato le dimensioni a 1024 Mb e ha funzionato.

Problemi correlati