[rabbitmq-discuss] the meaning of prefetch ?

林涵 oldhomelh at gmail.com
Wed Oct 24 09:56:44 BST 2012


Thanks for you answers .  if we have a queue ,and many consumers
> subscribe the queue,these consumers  has  a common prefetch
> value,assuming it is 20.if the queue has 20 msg , the rabbitmq will send
> the whole msg to one queue or every queue ?. if send to one ,it means
> other consumers will be idle  ?

2012/10/24 Emile Joubert <emile at rabbitmq.com>

> Hi Andy,
>
> On 23/10/12 00:43, D调的#暖冬 wrote:
> >  1. In offical website ,it describe that :" it is useful to be able to
> > specify how many messages each consumer can be sent at once before
> > sending the next acknowledgement" . when we first request the server, we
> > can get the amount which  defined by prefetch of messages  into my
> > client buffere pool,then my application will process it,if it can be
> > successfully processed ,the client need send a ACK back to the server,
> > to notice server that the message can be delete.Next,I doubt that
> > whether the server will re-send  some new messages to client?  and  the
> > amount  equals the  value of the prefetch or not  ?
>
> That is correct. As soon as the client send an ACK to the server, the
> server will send more messages. The multiple flag was set then many
> messages may be sent (up to prefetch messages). If the multiple flag was
> not set then only one message will be sent:
> http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.ack.multiple
> If there are no messages in the queue, then the client must wait until
> more messages arrive.
>
> > 2.when the prefetch  define  will has  effect on my application?
>
> If your application is driven by a queue subscription then it may well
> have an effect.
>
>
> -Emile
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121024/0e7020fd/attachment.htm>


More information about the rabbitmq-discuss mailing list