Thank you for your email and making things a lot clear. However what if I send an asynchronous acknowledgment like session.Acknowledge(false); will it be similar in performance to sending a parameter less acknowledgment. Which one will be better for clients that receive high frequency messages?
On Thu, Nov 29, 2012 at 3:36 AM, Gordon Sim <g...@redhat.com> wrote: > 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<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<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-unsubscribe@qpid.apache.**org<users-unsubscr...@qpid.apache.org> > For additional commands, e-mail: users-h...@qpid.apache.org > >