0

Is it possible to delete a message once it has been consumed? Example below creates and consumes the message but does not delete the message. Watching the RabbitMQ web interface and the message flicks between Ready and Unacked.

Producer (My Service)

 using (var messagebus = RabbitHutch.CreateBus("host=localhost;persistentMessages=false"))
            {
                var myrequest = new MyRequest();
                messagebus.Publish(myrequest);
            }

Consumer (My App)

MessageBus = RabbitHutch.CreateBus(Settings.Default.MessageBusParams);
MessageBus.Subscribe<MyRequest>("TheQueue", DoSomething);
wonea
  • 4,783
  • 17
  • 86
  • 139
  • Does DoSomething dispose of MessageBus by any chance? The message isn't ack'd until the handler has completed, so if you dispose of the connection to the broker before that, it will stay on the queue. – Mike Hadlow Dec 13 '14 at 20:47
  • The general pattern for using EasyNetQ is that you create a connection (by calling RabbitHutch.CreateBus) when your application starts and dispose of it when the application exits. – Mike Hadlow Dec 13 '14 at 20:48
  • Your right I was getting the message, then disposing the queue. The DoSomething() method restarted the Application, and the message was never properly consumed. – wonea Dec 16 '14 at 13:44

0 Answers0