[rabbitmq-discuss] How do I delete a persistent message after successul consuming

Alvaro Videla videlalvaro at gmail.com
Tue Apr 1 20:56:16 BST 2014


Hi,

See "Message acknowledgment" here:
http://www.rabbitmq.com/tutorials/tutorial-two-dotnet.html

Regards,

Alvaro

On Tue, Apr 1, 2014 at 9:51 PM, anate <ambatinr at hotmail.com> wrote:
> I have a durable and persistent message and trying to consume it and insert
> into the database. If everything goes well(no exception) then I would like
> to delete a message from queue. I don't see any examples online using C#.
> Could you please let me know?
>
>          try{
>             using (IConnection connection =
> connectionFactory.CreateConnection())
>             {
>                 using (var channel = connection.CreateModel())
>                 {
>                    channel.QueueDeclare("hello-world-queue", false, true,
> false, null);
>
>                     var consumer = new QueueingBasicConsumer(channel);
>                     channel.BasicConsume("hello-world-queue", true,
> consumer);
>
>                     while (true)
>                     {
>                         var ea =
> (BasicDeliverEventArgs)consumer.Queue.Dequeue();
>                         //Insert data into database
>                         // delete message from queue
>                     }
>                 }
>               }
>              }
>              catch(ex as Exception)
>              {
>                       // show error message
>              }
>
>
>
>
>
> --
> View this message in context: http://rabbitmq.1065348.n5.nabble.com/How-do-I-delete-a-persistent-message-after-successul-consuming-tp34473.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list