We use MassTransit (3.5.2) together with RabbitMQ (3.6.6). We have a problem with a message that is never removed from the queue (even if we read and used the message). To read from the queue, we have implemented the IConsumer class.
The only thing we do is close the sender (cool). After that, the message never receives confirmation, and rabbitmq continues to send the same message to our consumer all the time.
Has anyone else had the same problem and how did you solve this problem?
:: Update from comments ::
We have already checked the log files, and he says: "Closing the AMQP connection <0.18285.1> ([:: 1]: 57008 β [:: 1]: 5672): the client unexpectedly closed the TCP connection." This does not feel like wierd, since I actually close the tcp connection unexpectedly with killing the .exe file :)
As for the log files from masstransit, we also did this, and we get no errors, we only get two debug messages. The one we received and the one we ship. DEBUG 47 MassTransit.Messages - RECEIVE rabbitmq: // localhost / [VirtualHost] / [ConsumerName] N / A ContractCommand CommandConsumer (00: 00: 00.0364932) DEBUG 30 MassTransit.Messages - SEND rabbitmq: // localhost / [VirtualHost] / bus - [ComputerName] - [Sende rName] .Server.vshost -4bayyydsf9rfs3qzbdk gx8bbr1? Durable = fals e & autodelete = true d0700000-762f -c85b-f03a-08d4679c39d4 Result
One of the comments that I made in my consumer is that at the same time, when I try to close my sender, I get a MessageNotConfirmedException, followed by some AlreadyClosedException from RabbitMQ. And after that we get an infinite loop when MT does not set ACK / NACK. (and in an infinite loop, I don't get any MessagenNotConfirmedException). Also for my consumer to work correctly again I need to reboot my consumer, then it will be ACK / NACKed.
MessageNotConfirmedMessage: "'MassTransit.RabbitMqTransport.MessageNotConfirmedException' in mscorlib.dll Additional information: rabbitmq: // localhost / [VirtualHost] / bus- [ComputerName] - [Servi ce] .Server.vshost-4b ayysfdsbd 5b9 verified by RabbitMQ 'RabbitMQ.Client.Exceptions.AlreadyClosedException' Additional information: already closed: AMQP operation was aborted: AMQP close-reason initiated by Peer, code = 404, text = "NOT_FOUND - no exchange" bus- [ComputerName] - [ServiceName ] .Server.vshost-4bayyydsf9rf s3qzbdkgx8bbr1 'in vhost' [VirtualHost] '", classId = 60, methodId = 40, cause =