I have a batch job where the job is divided into multiple small messages and pushed to queue and multiple workers listening to queue would pick up and process these messages.
When connection reset happened as shown below the same message was picked up by another worker instance even when the 1st worker has picked it before and is still processing.
ERROR org.springframework.amqp.rabbit.connection.CachingConnectionFactory$DefaultChannelCloseLogger:Channel shutdown: connection error
com.rabbitmq.client.impl.ForgivingExceptionHandler:An unexpected connection driver error occured (Exception message: Connection reset)
This happened only with one message of a particular job and the connection reset time matches with that particular message redispatch.
I would want to know if this is a valid functionality as part of rabbitmq autoRecovery and unavoidable ?
Correct; any unacknowledged message will be requeued and redelivered after a connection reset.