On 11/28/2012 09:16 PM, Rajesh Khan wrote:
I have something like the following code in the receiver. I am currently
dealing with 1000's of messages in perhaps less than 30 seconds.
I read in the broker manual that by default only one message is extracted
by the receiver from the broker however using prefetch I could receive more
than one message at a time.
How can I implement prefetch in my code any suggestions.

You just need to set the Capacity property on the receiver to whatever size of prefetch you want.

I read that
setting the count value helps. Is there a way to find out how many messages
the receiver pulls out during each fetch from the broker?

The fetch call returns at most one message. However if prefetch is enabled - i.e. if there is a non-zero capacity - then there may already be messages on the client available to fetch, without needing to wait for the broker. You can get this count through the Available property of the receiver.

[See http://qpid.apache.org/books/0.18/Programming-In-Apache-Qpid/html/prefetch.html and http://qpid.apache.org/books/0.18/Programming-In-Apache-Qpid/html/ch05s03.html#id2560547]

How can I
optimize my receiver to receive from queues. Any suggestions would be
appreciated.

Setting the capacity is the most important one, another is to batch acknowledgements if you can e.g. issue the Acknowledge every N messages (where N is 10 or something like that).

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to