<html><head><base href="x-msg://32/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br><div><div>On 9 Sep 2013, at 19:29, Li, Mike wrote:</div><blockquote type="cite"><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: 15px; ">I was able to complete <a href="http://www.rabbitmq.com/tutorials/tutorial-one-python.html" style="color: blue; text-decoration: underline; ">http://www.rabbitmq.com/tutorials/tutorial-one-python.html</a> to tutorial-three-phython.html</span><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">When I tried using SendString and SingleGet .NET binaries, and rabbitmqctl.bat I net getting much luck.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "></div></div></div></span></blockquote><div><br></div><div>Have you tried writing code similar to the python tutorial using the .NET client? Looking at <a href="https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/dotnet">https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/dotnet</a> might help, though that's probably very out of date.</div><div><br></div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">But no message in the hello queue found.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "></div></div></div></span></blockquote><div><br></div><div>Well indeed - queues are not magically created for you, you've got to declare them either in your code or using one of the various management tools.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Manually added message via Queue > hello > Publish message (and added messages using steps in tutorial-one-python.html)<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div></div></span></blockquote><div><br></div><div>That's one way to do it.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Tried getting the message failed also:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">c:\RabbitMQ.NetClient\bin>singleget "<a href="amqp://guest:guest@127.0.0.1:5672/" style="color: blue; text-decoration: underline; ">amqp://guest:guest@127.0.0.1:5672/</a>" hello<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div></div></span></blockquote><div><br></div><div>The reason for the the failure is tucked away in the exception message here:</div><br><blockquote type="cite"><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: 15px; ">text="PRECONDITION_FAILED - parameters for queue 'hello' in vhost '/' not equ</span><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: 15px; ">ivalent"</span></span></blockquote><div><br></div><div>Before singleget attempts to issue a basic.get, it declares the target queue - using queue.declare - to ensure it's present. This is fine, since queue.declare is idempotent - if the queue already exists, the declaration acts like an assertion, otherwise it creates the queue. As you can see below, the code in SingleGet that declares the queue makes very specific assumptions about parameters:</div><div><br></div><div><div> using (IModel ch = conn.CreateModel()) {</div><div> conn.AutoClose = true;</div><div><br></div><div> ch.QueueDeclare(queueName, false, false, false, null);</div><div> BasicGetResult result = ch.BasicGet(queueName, false);</div><div> if (result == null) {</div><div> Console.WriteLine("No message available.");</div><div> } else {</div><div> ch.BasicAck(result.DeliveryTag, false);</div><div> Console.WriteLine("Message:");</div><div> DebugUtil.DumpProperties(result, Console.Out, 0);</div><div> }</div><div><br></div><div> return 0;</div><div> }</div><div><br></div><div>So at the time that queue.declare method is issued to the server, if the queue that you manually created on the server was configured with *different* parameters, the queue.declare method will fail and a channel error will be raised, invalidating the channel and throwing an exception in the client.</div></div><br><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Please advise.</div></div></div></blockquote><div><br></div><div>Make sure that the queue you're consuming via SingleGet was declared with exactly these same parameters. Alternatively, write you own code to consume messages from the queue, and ensure that when calling the channel's QueueDeclare method, you provide the same parameters that the queue was originally declared/created with.</div><div><br></div><div>Cheers,</div><div>Tim</div><div><br></div></div></div></body></html>