<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Michael,<div><br></div><div><br></div><div>I am using "test.abc" as routing key for both Publish and consume. I had put the comments below on what values are used for queueName, routingKey and exchangeName. For basicPublish, I am not using any queue.bind since this is publishing to exchange.</div><div><br></div><div>Only the consumer is using the queue.bind on the queueName, exchangeName.</div><div><br></div><div>Any help:</div><div>Publish code:</div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>Connection conn = <span style="color: #0326cc">factory</span>.newConnection(<span style="color: #0326cc">addr</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>Channel channel = conn.createChannel();</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.exchangeDeclare(<span style="color: #0326cc">"localExchange"</span>, <span style="color: #0326cc">"topic"</span>, <span style="color: #931a68">true</span>); <span style="color: #4e9072">// durable</span></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.basicPublish(<span style="color: #0326cc">"localExchange"</span>, "test.abc", <span style="color: #931a68">null</span>, msg.getBytes());</div></div><div><br></div><div>Consumer code:</div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">                </span>Connection conn =&nbsp;<span style="color: rgb(3, 38, 204); ">factory</span>.newConnection(<span style="color: rgb(3, 38, 204); ">addr</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>Channel channel = <span style="color: #0326cc">conn</span>.createChannel();</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(78, 144, 114); "><span class="Apple-tab-span" style="white-space: pre; ">                </span>channel.exchangeDeclare(<span style="color: rgb(3, 38, 204); ">"localExchange"</span>, <span style="color: rgb(57, 51, 255); ">"direct"</span>, <span style="color: rgb(147, 26, 104); ">true</span>);</div></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.queueDeclare(<span style="color: #0326cc">"Notification"</span>, <span style="color: #931a68">true</span>, <span style="color: #931a68">false</span>, <span style="color: #931a68">false</span>, <span style="color: #931a68">null</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.queueBind(<span style="color: #0326cc">"Notification"</span>, <span style="color: #0326cc">"localExchange"</span>, "test.abc");</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>QueueingConsumer qCon = <span style="color: #931a68">new</span> QueueingConsumer(channel);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;channel.basicConsume(<span style="color: rgb(3, 38, 204); ">"Notification"</span>, <span style="color: rgb(147, 26, 104); ">false</span>, qCon);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(147, 26, 104); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span>while<span style="color: #000000"> (</span>true<span style="color: #000000">) {</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>&nbsp; &nbsp;Delivery delivery = qCon.nextDelivery();</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>&nbsp; &nbsp;System.<span style="color: #0326cc">out</span>.println(<span style="color: #3933ff">"[x] "</span> + <span style="color: #931a68">new</span> String(delivery.getBody()) + <span style="color: #3933ff">" "</span> + delivery.getEnvelope().getRoutingKey());<span class="Apple-tab-span" style="white-space: pre; ">        </span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>&nbsp; &nbsp;qCon.getChannel().basicAck(delivery.getEnvelope().getDeliveryTag(), <span style="color: #931a68">false</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">Any suggestions?</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">Thx,</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">Murugesan</div><div><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(78, 144, 114); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div><span style="color: #4e9072"><br></span></div><div><div>On Nov 4, 2013, at 8:12 AM, Michael Klishin &lt;<a href="mailto:mklishin@gopivotal.com">mklishin@gopivotal.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>On 4 Nov 2013, at 10:22, Murugesan Guruswamy &lt;<a href="mailto:murugesan@elementum.com">murugesan@elementum.com</a>&gt; wrote:<br><br><blockquote type="cite">Routing key : "test.abc", queueName : Notification, exchangeName : localExchange.<br><br>Is there any rabbitmq-server configurations to do?<br></blockquote><br>Direct and topic exchange route message based on routing key of the message.<br>Your example does not show if the key used in queue.bind matches the one used in basic.publish<br>but it’s very likely to be the issue.<br><br>Also, you do not consume messages from exchanges.<br><br>See tutorials 3-5 for more info <a href="http://www.rabbitmq.com/getstarted.html">http://www.rabbitmq.com/getstarted.html</a><br>and <a href="http://www.rabbitmq.com/tutorials/amqp-concepts.html">http://www.rabbitmq.com/tutorials/amqp-concepts.html</a>.<br><br>Use RabbitMQ management UI to see bindings, message rates and more:<br><a href="http://www.rabbitmq.com/management.html">http://www.rabbitmq.com/management.html</a><br><br>MK<br><br>Software Engineer, Pivotal/RabbitMQ<br><br><br></blockquote></div><br></div></body></html>
<br>


<p><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Legal Disclaimer: The information
contained in this message may be privileged and confidential. It is intended to
be read only by the individual or entity to whom it is addressed or by their
designee. If the reader of this message is not the intended recipient, you are
on notice that any distribution of this message, in any form, is strictly prohibited.
If you have received this message in error, please immediately notify the
sender and delete or destroy any copy of this message </span></p>