How to get messages count which are not consumed from queue?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get messages count which are not consumed from queue?

Srinath Sridharan -X (srinatsr - ZENSAR TECHNOLOGIES INC at Cisco)

Hi All,

 

I need to get only messages count which are not consumed ?

 

How to avoid requeueing mechanism ?  I don’t want any messages to be requeued.  I want all consumed messages to be acknowledged even though if any exceptions occur.

 

 

 

Regards …?

Srinath

 


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How to get messages count which are not consumed from queue?

Michael Klishin-2
 On 13 May 2014 at 21:33:17, Srinath Sridharan -X (srinatsr - ZENSAR TECHNOLOGIES INC at Cisco) ([hidden email]) wrote:
> > I need to get only messages count which are not consumed ?

Declare a queue and see the response (queue.declare-ok). Passive declare is
sufficient.
--  
MK  

Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How to get messages count which are not consumed from queue?

Alvaro Videla-2
In reply to this post by Srinath Sridharan -X (srinatsr - ZENSAR TECHNOLOGIES INC at Cisco)
On Tue, May 13, 2014 at 7:32 PM, Srinath Sridharan -X (srinatsr - ZENSAR TECHNOLOGIES INC at Cisco) <[hidden email]> wrote:

How to avoid requeueing mechanism ?  I don’t want any messages to be requeued.  I want all consumed messages to be acknowledged even though if any exceptions occur.


So you essentially want RabbitMQ to discard your message as soon as the message is send to the consumer. If that's the case, what you want is to issue a basicConsume with no_ack = true. Be aware that is an unsafe operation: if an exception occurs you will lose that message.

_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How to get messages count which are not consumed from queue?

Srinath Sridharan -X (srinatsr - ZENSAR TECHNOLOGIES INC at Cisco)
In reply to this post by Michael Klishin-2
Thanks Michael.

Can I have a piece of sample code in Java.  I have my queue declared and how to see the response for queue.declare-ok ??

Regards ……
Srinath

-----Original Message-----
From: rabbitmq-discuss [mailto:[hidden email]] On Behalf Of Michael Klishin
Sent: Tuesday, May 13, 2014 10:50 AM
To: Discussions about RabbitMQ
Subject: Re: [rabbitmq-discuss] How to get messages count which are not consumed from queue?

 On 13 May 2014 at 21:33:17, Srinath Sridharan -X (srinatsr - ZENSAR TECHNOLOGIES INC at Cisco) ([hidden email]) wrote:
> > I need to get only messages count which are not consumed ?

Declare a queue and see the response (queue.declare-ok). Passive declare is sufficient.
--
MK  

Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How to get messages count which are not consumed from queue?

michaelklishin
2014-05-13 22:27 GMT+04:00 Srinath Sridharan -X (srinatsr - ZENSAR TECHNOLOGIES INC at Cisco) <[hidden email]>:
I have my queue declared and how to see the response for queue.declare-ok ??

Channel#queueDeclare returns AMQP.Queue.DeclareOk. If you take a look at the Javadoc,


is pretty easy to find.
--
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss