Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15093

Camel rabbitMQ throws com.rabbitmq.client.AlreadyClosedException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Abandoned
    • 2.23.2
    • None
    • camel-rabbitmq
    • None
    • Unknown

    Description

      Expected functionality

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

       

      Actual error

       

      1. I send 100 messages to the queue
      2. The camel consumer consumes the messages and sends it to the Backend Mocking system
      3. The backend mock sends back a 500 status message
      4. The messages is retries three times and send back to failover queue.
      5. 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,

      1. 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            SRAJHMRC Sacintha Raj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: