<div dir="ltr">Hi guys,<br><br>Here is a reference to my stackoverflow post. Basically I'm wondering if I'm using nack as intented or not. <br><br><a href="http://stackoverflow.com/questions/21244281/basic-nack-not-being-processed">http://stackoverflow.com/questions/21244281/basic-nack-not-being-processed</a><br><br><p style="font-size: 14px; clear: both; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">ere is what I am trying to do:</p><ol style="margin: 0px 0px 1em 30px; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; list-style-position: initial; list-style-image: initial; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px;"><li style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">Dequeue a message</li><li style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">Do an action with the message</li><li style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">If the action fails, put the message back in the queue</li><li style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">If the action succeeds, acknowldge the message</li></ol><p style="font-size: 14px; clear: both; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">My problem right now is that, if the action fails, the message isn't requeued, but stays unacknowledged. If I go in RabbitMQ web congifuration interface, I see that the messages are flagged as unacknowledged, even tho, the basic.Nack has been stepped over.</p><pre class="lang-cs prettyprint prettyprinted" style="margin-bottom: 10px; padding: 5px; font-size: 14px; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; overflow: auto; width: auto; max-height: 600px; word-wrap: normal; color: rgb(0, 0, 0); line-height: 18px;"><code style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"><span class="kwd" style="background-color: transparent; color: rgb(0, 0, 139);">var</span><span class="pln" style="background-color: transparent;"> delivery </span><span class="pun" style="background-color: transparent;">=</span><span class="pln" style="background-color: transparent;"> subscription</span><span class="pun" style="background-color: transparent;">.</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">Next</span><span class="pun" style="background-color: transparent;">();</span><span class="pln" style="background-color: transparent;">
</span><span class="kwd" style="background-color: transparent; color: rgb(0, 0, 139);">var</span><span class="pln" style="background-color: transparent;"> messageBody </span><span class="pun" style="background-color: transparent;">=</span><span class="pln" style="background-color: transparent;"> delivery</span><span class="pun" style="background-color: transparent;">.</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">Body</span><span class="pun" style="background-color: transparent;">;</span><span class="pln" style="background-color: transparent;">
</span><span class="kwd" style="background-color: transparent; color: rgb(0, 0, 139);">try</span><span class="pln" style="background-color: transparent;">
</span><span class="pun" style="background-color: transparent;">{</span><span class="pln" style="background-color: transparent;">
action</span><span class="pun" style="background-color: transparent;">.</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">Invoke</span><span class="pun" style="background-color: transparent;">(</span><span class="pln" style="background-color: transparent;">messageBody</span><span class="pun" style="background-color: transparent;">);</span><span class="pln" style="background-color: transparent;">
subscription</span><span class="pun" style="background-color: transparent;">.</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">Ack</span><span class="pun" style="background-color: transparent;">(</span><span class="pln" style="background-color: transparent;">delivery</span><span class="pun" style="background-color: transparent;">);</span><span class="pln" style="background-color: transparent;">
</span><span class="pun" style="background-color: transparent;">}</span><span class="pln" style="background-color: transparent;">
</span><span class="kwd" style="background-color: transparent; color: rgb(0, 0, 139);">catch</span><span class="pln" style="background-color: transparent;"> </span><span class="pun" style="background-color: transparent;">(</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">Exception</span><span class="pln" style="background-color: transparent;"> ex</span><span class="pun" style="background-color: transparent;">)</span><span class="pln" style="background-color: transparent;">
</span><span class="pun" style="background-color: transparent;">{</span><span class="pln" style="background-color: transparent;">
subscription</span><span class="pun" style="background-color: transparent;">.</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">Model</span><span class="pun" style="background-color: transparent;">..</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">BasicNack</span><span class="pun" style="background-color: transparent;">(</span><span class="pln" style="background-color: transparent;">delivery</span><span class="pun" style="background-color: transparent;">.</span><span class="typ" style="background-color: transparent; color: rgb(43, 145, 175);">DeliveryTag</span><span class="pun" style="background-color: transparent;">,</span><span class="pln" style="background-color: transparent;"> </span><span class="kwd" style="background-color: transparent; color: rgb(0, 0, 139);">false</span><span class="pun" style="background-color: transparent;">,</span><span class="pln" style="background-color: transparent;"> </span><span class="kwd" style="background-color: transparent; color: rgb(0, 0, 139);">true</span><span class="pun" style="background-color: transparent;">);</span><span class="pln" style="background-color: transparent;">
</span><span class="kwd" style="background-color: transparent; color: rgb(0, 0, 139);">throw</span><span class="pln" style="background-color: transparent;"> ex</span><span class="pun" style="background-color: transparent;">;</span><span class="pln" style="background-color: transparent;">
</span><span class="pun" style="background-color: transparent;">}</span></code></pre></div>