<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Yeh I thought about it a little more and just using the technique where the server pushes changes to the consumer makes most sense here. Thanks for the quick reply Jason.</div>
<div><br>
</div>
<div>AJ</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Jason McIntosh <<a href="mailto:mcintoshj@gmail.com">mcintoshj@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>Discussions about RabbitMQ <<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>><br>
<span style="font-weight:bold">Date: </span>Monday, March 10, 2014 9:15 AM<br>
<span style="font-weight:bold">To: </span>Discussions about RabbitMQ <<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [rabbitmq-discuss] RabbitMQ: Different consumer technique<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Seems like a lot of heavy lifting for a consumer process. If you use the alternative where rabbit pushes changes to your consumer (instead of basic_get), then rabbit will push new messages as they come in to your consumer, and the consumer will
be idle otherwise using minimal resources. For "basic.get_batch" - that's exactly what the prefetch count does on consumers - get 10 messages at once and process them. Is there some particularly need to wrap it in all the extra layers?
<div>Jason</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Mar 10, 2014 at 10:43 AM, Ajinkya Apte <span dir="ltr">
<<a href="mailto:aapte@zynga.com" target="_blank">aapte@zynga.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(First time user of RabbitMQ)<br>
Hey,<br>
Technique:<br>
Rather than writing a standalone PHP consumer script that keeps consuming the queue, I was planning on writing a batch get and quit PHP script. All that script does is get a batch of 10 from the queue, if the batch isn't available the script immediately exits.
If available, it processes the batch and quits. I use a python script to make multiple calls to my 'Get Batch script' and make use of apache workers to do the work rather than making the php standalone script do the work.<br>
<br>
Questions:<br>
1. Firstly, do you see a reason why I should not think about consuming the queue this way?<br>
2. (I am using the amq php lib) How can I do a batch get and exit if the batch is not present. With what I have learnt seems like I can set the qos to my batch count and use batch_consume for this. But if the batch is not available the script seems to wait
till the batch is available. Is there a way I can timeout?<br>
3. Do you have any usage recommendation for me?<br>
4. Any plans of having basic.get_batch?<br>
<br>
AJ<br>
<br>
Sent from my iPhone<br>
<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">Jason McIntosh<br>
<a href="https://github.com/jasonmcintosh/" target="_blank">https://github.com/jasonmcintosh/</a><br>
573-424-7612</div>
</div>
</div>
</div>
</span>
</body>
</html>