<div dir="ltr">Hi,<div><br></div><div>I am trying to experiment exchanges and publishing it to an exchange using following code:</div><div><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; 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>);</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>Channel channel = conn.createChannel();</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.exchangeDeclare(<span style="color: #0326cc">exchangeName</span>, <span style="color: #0326cc">topicName</span>, <span style="color: #931a68">true</span>); <span style="color: #4e9072">// durable. topic is "direct" and "topic" and have tried both</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco; "><span style="color: #4e9072"> </span>channel.basicPublish(<span style="color: rgb(3, 38, 204); ">exchangeName</span>, routingKey, <span style="color: rgb(147, 26, 104); ">null</span>, msg.getBytes());</p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco; "><br></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco; ">consumer code: (Tried both Queueing Consumer and my own Consumer imll).</p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco; "></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                </span>Channel channel = <span style="color: #0326cc">conn</span>.createChannel();<span class="Apple-tab-span" style="color: rgb(0, 0, 0); white-space: pre; ">                </span></p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.exchangeDeclare(<span style="color: #0326cc">exchangeName</span>, <font color="#3933ff">topicName</font>, <span style="color: #931a68">true</span>);</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; min-height: 15px; "><span class="Apple-tab-span" style="white-space:pre">                </span>c<span style="color: rgb(78, 144, 114); ">hannel.queueDeclare(</span><span style="color: rgb(3, 38, 204); ">queueName</span><span style="color: rgb(78, 144, 114); ">, </span><span style="color: rgb(147, 26, 104); ">true</span><span style="color: rgb(78, 144, 114); ">, </span><span style="color: rgb(147, 26, 104); ">false</span><span style="color: rgb(78, 144, 114); ">, </span><span style="color: rgb(147, 26, 104); ">false</span><span style="color: rgb(78, 144, 114); ">, </span><span style="color: rgb(147, 26, 104); ">null</span><span style="color: rgb(78, 144, 114); ">);</span></p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.queueBind(<span style="color: #0326cc">queueName</span>, <span style="color: #0326cc">exchangeName</span>, routingKey);</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; color: rgb(78, 144, 114); "><span class="Apple-tab-span" style="white-space: pre; ">                </span>QueueingConsumer qCon = <span style="color: rgb(147, 26, 104); ">new</span> QueueingConsumer(channel);<br></p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; min-height: 15px; "><span class="Apple-tab-span" style="white-space:pre">                </span></p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                </span>channel.basicConsume(<span style="color: #0326cc">queueName</span>, <span style="color: #931a68">false</span>, qCon);</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; color: rgb(78, 144, 114); "><span style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: rgb(147, 26, 104); ">while</span><span style="color: rgb(0, 0, 0); "> (</span><span style="color: rgb(147, 26, 104); ">true</span><span style="color: rgb(0, 0, 0); ">) {</span><br></p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                        </span>Delivery delivery = qCon.nextDelivery();</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                        </span>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());</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; min-height: 15px; "><span class="Apple-tab-span" style="white-space:pre">                        </span></p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                        </span>qCon.getChannel().basicAck(delivery.getEnvelope().getDeliveryTag(), <span style="color: #931a68">false</span>);</p>
<p style="margin-bottom: 0px; font-size: 11px; line-height: normal; "><span class="Apple-tab-span" style="white-space:pre">                </span>}</p><div><br></div><div>Routing key : "test.abc", queueName : Notification, exchangeName : localExchange.</div><div><br></div><div>Is there any rabbitmq-server configurations to do?</div><div><br></div><div>Please help here.</div><div><br></div><div>Thanks,</div><div>Murugesan</div><p></p></div><div><br></div><div><span style="color: #4e9072"><br></span></div></div>
<br>
<p><span style="font-size:10.5pt;font-family:"Calibri","sans-serif"">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>