<div dir="ltr">Actually the Consumer that receive the first stop message should receive also N-1 &quot;I finished my stuff&quot; messages from the other N -1 consumers..<div>But I think it could be quite easily feasible..summarizing, tell me if this could be a good workflow:</div>

<div><br></div><div>1) One of the N consumers receive the end-message</div><div>2) This consumer opens a new temporary feedback-queue to receive feedbacks from other consumers and post to a fanout control queue a &quot;wait for end of processing&quot; to all other consumers (containing also the id of the feedback-queue)</div>

<div>3) Sender ignores such message, other consumers sends a�&quot;I finished my stuff&quot; message once finished their work to the feedback-queue (whose id is indicated in the &quot;wait for end of processing&quot; message)</div>

<div>4) Once that the Consumer who initiated the &quot;stop phase&quot; receive all the N-1 feedbacks (or after a certain timeout) it can delete the temporary feedback queue and start the map reduce job</div><div><br></div>

<div>What is missing in this scenario is how consumers can be informed of the number of active consumers (i.e. N)..any help about this? Do you think this steps could be reasonable?</div><div><div class="gmail_extra"><br>
<div class="gmail_quote">
On Wed, Jul 24, 2013 at 1:10 PM, Michael Klishin <span dir="ltr">&lt;<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Flavio Pompermaier:<br>
<div class="im"><br>
&gt; If not, could you please give me some more reference or hint about implementing the solution you proposed?<br>
<br>
</div>just make the consumer that receives the first &quot;stop&quot; message publish a message that all<br>
consumers will get (via a separate queue).<br>
<br>
Note that to avoid an infinite loop of messages, you need to mark such control messages<br>
and make sure other consumers don&#39;t publish anything, just stop.<br>
<br>
Then the consumer that&#39;s got the first &quot;stop&quot; message can start a map/reduce job.<br>
--<br>
MK<br></blockquote></div><div dir="ltr"><p></p><p></p><p></p><p></p></div>
</div></div></div>