<div dir="ltr"><div>Thank you sir, works great.<br><br></div>Cheers.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 28, 2013 at 12:07 PM, Simon MacMullen <span dir="ltr"><<a href="mailto:simon@rabbitmq.com" target="_blank">simon@rabbitmq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 28/11/13 14:56, Marcos Torres wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi there.<br>
<br>
The messages stored in a durable queue doesn't survive a service restart<br>
(I'm using windows version of Rabbit).<br>
I'm using message confirmation, but clearly I need to do something else.<br>
</blockquote>
<br></div>
You are not marking messages as persistent. I am no .NET expert but I think you need something like:<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is how I'm publishing the messages :<br>
<br>
� � � � � � � � �using (var channel =<br>
rabbitConnection.Connection.<u></u>CreateModel())<br>
� � � � � � � � �{<br>
� � � � � � � � � � �channel.ConfirmSelect(); //enable confirms on channel<br>
</blockquote>
<br></div>
IBasicProperties props = channel.CreateBasicProperties(<u></u>);<br>
props.DeliveryMode = 2; // Persistent<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
� � � � � � � � � � �foreach (var message in messages)<br>
� � � � � � � � � � �{<br>
� � � � � � � � � � � � �var serialization =<br>
_serializer.Serialize(message , Encoding.UTF8);<br>
</blockquote>
<br>
� � � � � � � � � � � � � �channel.BasicPublish(<u></u>rabbitAddress.Name,<br></div>
string.Empty, props, serialization);<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
� � � � � � � � � � �}<br>
� � � � � � � � � � �channel.WaitForConfirms();<br>
� � � � � � � � �}<br>
</blockquote>
<br>
Cheers, Simon<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Simon MacMullen<br>
RabbitMQ, Pivotal<br>
</font></span></blockquote></div><br></div>