<div dir="ltr">Also, I guess I don't need addConfirmListener attach to the channel if using "waitForConfirmOrDie" method right?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 1:38 PM, cw storm <span dir="ltr"><<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">MK,<div><br></div><div>There's also�<span style="font-size:1em">waitForConfirmsOrDie(long�timeout). �Timout is in seconds, right?</span></div>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Feb 26, 2014 at 1:37 PM, cw storm <span dir="ltr"><<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Thanks MK. �I was just about to say. �Use�<span style="font-size:12px">ch.waitForConfirmsOrDie(); instead, right?</span></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Wed, Feb 26, 2014 at 1:25 PM, Michael Klishin <span dir="ltr"><<a href="mailto:michael.s.klishin@gmail.com" target="_blank">michael.s.klishin@gmail.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2014-02-26 22:16 GMT+04:00 cw storm <span dir="ltr"><<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>></span>:<div>


<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>I'm trying to understand the below snippet:</div><div><br></div><div><pre style="color:rgb(85,85,85);font-size:13px;line-height:18px">for (long i = 0; i < MSG_COUNT; ++i) {
     unconfirmedSet.add(ch.getNextPublishSeqNo());
     ch.basicPublish("", QUEUE_NAME, MessageProperties.PERSISTENT_BASIC,
                       "nop".getBytes());
 }
while (unconfirmedSet.size() > 0)
     Thread.sleep(10);</pre><pre style="color:rgb(85,85,85);font-size:13px;line-height:18px">As stated, "<span style="font-family:Verdana,sans-serif">the producer waits for all the messages to be confirmed."  Assuming that's the above code.  Is the "while" logic safe?  What happens when the "unconfirmedSet.size" is always greater than 0?  Also, the "MSG_COUNT" if set to 10000, does the for loop will always loop 10000 times even though there might only be say 10 messages?</span></pre>




</div></blockquote></div></div><div class="gmail_extra">That blog post is over 2 years old.</div><br>Consider using Channel#waitForConfirms instead.<span><font color="#888888"><br>-- <br>MK<br><br><a href="http://github.com/michaelklishin" target="_blank">http://github.com/michaelklishin</a><br>




<a href="http://twitter.com/michaelklishin" target="_blank">http://twitter.com/michaelklishin</a><br>
</font></span></div></div>
<br></div></div><div>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
</div><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>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>