You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Sacintha Raj (Jira)" <ji...@apache.org> on 2020/05/21 08:05:00 UTC

[jira] [Created] (CAMEL-15093) Camel rabbitMQ throws com.rabbitmq.client.AlreadyClosedException

Sacintha Raj created CAMEL-15093:
------------------------------------

             Summary: Camel rabbitMQ throws com.rabbitmq.client.AlreadyClosedException
                 Key: CAMEL-15093
                 URL: https://issues.apache.org/jira/browse/CAMEL-15093
             Project: Camel
          Issue Type: Bug
          Components: camel-rabbitmq
    Affects Versions: 2.23.2
            Reporter: Sacintha Raj


Expected functionality
 # I send 100 messages to the queue
 # The camel consumer consumes the messages and sends it to the Backend Mocking system
 # The backend mock sends back a 500 status message
 # The messages is retries three times and send back to failover queue.
 # And all 100 messages are cleared from the main queue and pushed to failover queue.

 

Actual error

 
 # I send 100 messages to the queue
 # The camel consumer consumes the messages and sends it to the Backend Mocking system
 # The backend mock sends back a 500 status message
 # The messages is retries three times and send back to failover queue.
 # After 19 messages are processed and exception is thrown

com.rabbitmq.client.AlreadyClosedException: channel is already closed due to channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 101,
 # And inconsistency in message count is also found 86 messages are present in the main queue and 19 messages are present in the failover queue

 

 

 

UPDATE

After adding the options  "prefetchEnabled=true&prefetchCount=1"

The below exception is thrown

Consumer org.apache.camel.component.rabbitmq.RabbitConsumer@3240f425 (amq.ctag-SyXWmiQnlsHRDZ9sQAj99Q) method handleDelivery for channel AMQChannel(amqp://microservic

euser@172.16.2.200:5672/,1) threw an exception for channel AMQChannel(amqp://microserviceuser@172.16.2.200:5672/,1)

com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; cause: java.io.EOFException

 

The consumer code

 

from("rabbitmq:amq-direct?connectionFactory=#rabbitConnectionFactory&" +

                "autoDelete=false&prefetchEnabled=true&autoAck=false&prefetchCount=1&" +

                "routingKey=eis.ncts.ctc.oodes.request&queue=eis.ncts.ctc.oodes.request.queue")

 

 

The exception that is thrown on a rabbit Mq server

 

2020-05-20 14:40:44.089 [error] <0.2931.0> Channel error on connection <0.2913.0> (127.0.0.1:36072 -> 127.0.0.1:5672, vhost: '/', user: 'microserviceuser'), channel 1:

operation basic.ack caused a channel exception precondition_failed: unknown delivery tag 8



--
This message was sent by Atlassian Jira
(v8.3.4#803005)