Org.apache.activemq.transport.InactivityIOException: unable to submit, channel has not completed yet

I am using apache activemq for queues. We very often came across the following exception when writing things to the queue:

Caused by: org.apache.activemq.transport.InactivityIOException: Cannot send, channel has already failed: 
    at org.apache.activemq.transport.AbstractInactivityMonitor.doOnewaySend(AbstractInactivityMonitor.java:282)
    at org.apache.activemq.transport.AbstractInactivityMonitor.oneway(AbstractInactivityMonitor.java:271)
    at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:85)
    at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:104)
    at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)
    at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81)
    at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:86)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1366)

      

I can't figure out what could be causing this, or even honestly where to start debugging, what is causing this.

Here is the queue setup code:

    camelContext = new DefaultCamelContext();
    camelContext.setErrorHandlerBuilder(new LoggingErrorHandlerBuilder());
    camelContext.getShutdownStrategy().setTimeout(SHUTDOWN_TIMEOUT_SECONDS);

    routePolicy = new RoutePolicy();
    routePolicy.setCamelContext(camelContext);

    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
    connectionFactory.setBrokerURL(queueUri);
    // use a pooled connection factory between the module and the queue
    pooledConnectionFactory = new PooledConnectionFactory(connectionFactory);

    // how many connections should there be in the session pool?
    pooledConnectionFactory.setMaxConnections(this.maxConnections);
    pooledConnectionFactory.setMaximumActiveSessionPerConnection(this.maxActiveSessionPerConnection);
    pooledConnectionFactory.setCreateConnectionOnStartup(true);
    pooledConnectionFactory.setBlockIfSessionPoolIsFull(false);

    JmsConfiguration jmsConfiguration = new JmsConfiguration(pooledConnectionFactory);
    jmsConfiguration.setDeliveryPersistent(false); // do not store a copy of the messages on the queue

    ActiveMQComponent activeMQComponent = ActiveMQComponent.activeMQComponent(queueUri);
    activeMQComponent.setConfiguration(jmsConfiguration);
    camelContext.addComponent("activemq", activeMQComponent);
    Component activemq = camelContext.getComponent("activemq");

    // register endpoints for queues and topics
    Endpoint queueEndpoint = activemq.createEndpoint("activemq:queue:polaris.*");
    Endpoint topicEndpoint = activemq.createEndpoint("activemq:topic:polaris.*");
    producerTemplate = camelContext.createProducerTemplate();

    camelContext.start();
    queueEndpoint.start();
    topicEndpoint.start();

      

As I said, the error does not offer any direction for debugging, and it doesn’t happen 100% of the time that I can be sure that my configuration is wrong.

+3


source to share


2 answers


I recently faced the same problem. I found this https://issues.apache.org/jira/browse/AMQ-6600



The Apache ActiveMQ client throws an InactivityIOException when one of the jars is missing from the classpath. In my case, it was hawtbuf-1.11.jar. When I added this jar to the classpath, it started working without error.

+1


source


Check if there is a non-JMS client pinging your JMS broker. It could be an external monitoring tool, a load balancing tool like keepalived, or another.



0


source







All Articles