Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Abandoned
-
2.23.2
-
None
-
None
-
Unknown
Description
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