<div dir="ltr">try that ..... no luck - surely this works in .net?<div><div>var connection = connectionFactory.CreateConnection();</div><div><br></div><div><span class="" style="white-space:pre">         </span>        var channel = connection.CreateModel();</div>
<div><br></div><div><span class="" style="white-space:pre">           </span>        // Create a new, durable exchange</div><div><span class="" style="white-space:pre">          </span>        channel.ExchangeDeclare("sample-ex", ExchangeType.Direct, true, false, null);</div>
<div><span class="" style="white-space:pre">            </span>        // Create a new, durable queue</div><div><span class="" style="white-space:pre">             </span>        channel.QueueDeclare("sample-queue", true, false, false, null);</div>
<div><span class="" style="white-space:pre">            </span>        // Bind the queue to the exchange</div><div><span class="" style="white-space:pre">          </span>        channel.QueueBind("sample-queue", "sample-ex", "optional-routing-key");</div>
<div><br></div><div><span class="" style="white-space:pre">           </span>        // Set up message properties</div><div><span class="" style="white-space:pre">               </span>        var properties = channel.CreateBasicProperties();</div>
<div><span class="" style="white-space:pre">            </span>        properties.DeliveryMode = 2; // Messages are persistent and will survive a server restart</div><div><br></div><div><span class="" style="white-space:pre">         </span>        // Ready to start publishing</div>
<div><span class="" style="white-space:pre">            </span>        // The message to publish can be anything that can be serialized to a byte array, </div><div><span class="" style="white-space:pre">         </span>        // such as a serializable object, an ID for an entity, or simply a string</div>
<div><span class="" style="white-space:pre">            </span>        var encoding = new UTF8Encoding();</div><div><span class="" style="white-space:pre">         </span>        for (var i = 0; i < 1; i++)</div><div><span class="" style="white-space:pre">             </span>        {</div>
<div><span class="" style="white-space:pre">            </span>            var msg = string.Format("This is message derek #yyy{0}?", i + 1);</div><div><span class="" style="white-space:pre">            </span>            var msgBytes = encoding.GetBytes(msg);</div>
<div><span class="" style="white-space:pre">            </span>            channel.BasicPublish("sample-ex", "optional-routing-key", false, false, properties, msgBytes);</div><div><br></div><div><span class="" style="white-space:pre">            </span>        }</div>
<div><span class="" style="white-space:pre">            </span>        channel.Close();</div><div><span class="" style="white-space:pre">           </span>        connection.Close(); </div><div><span class="" style="white-space:pre">               </span>    </div>
<div><br></div><div><span class="" style="white-space:pre">           </span>    Console.WriteLine("Messages published");</div><div><span class="" style="white-space:pre">             </span>    Console.ReadKey(true);</div></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 19, 2014 at 4:30 PM, Michael Klishin <span dir="ltr"><<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 19 Feb 2014, at 20:22, Derek Johnston <<a href="mailto:derekejohnston@gmail.com">derekejohnston@gmail.com</a>> wrote:<br>
<br>
> is there a work around?<br>
<br>
Try closing connection manually instead of using `using`?<br>
<br>
MK<br>
<br>
Software Engineer, Pivotal/RabbitMQ<br>
<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></div>