<div dir="ltr">Thank you Russell. I could able to resolve after making change in replyQueue manually in configuration for the request.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 9:53 PM, Rajasekhar P <span dir="ltr">&lt;<a href="mailto:sekhar434145@gmail.com" target="_blank">sekhar434145@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Russell,<div><br></div><div>Here is the my listerner POJO , still am getting null response. I didnt do any reply queue/corrID configuration. <br>
<br><div>      // receive messages</div><div><span style="white-space:pre-wrap">        </span>public Object handleMessage(String query) {</div>
<div><span style="white-space:pre-wrap">                </span>Test test = new Test(&quot;Pandit&quot;, &quot;Pillai&quot;);</div><div><span style="white-space:pre-wrap">                </span>return test;</div><div><span style="white-space:pre-wrap">        </span>}<br>

<br>Producer - <br><br><div>Test response = (Test)this.rabbitTemplate.convertSendAndReceive(msg);</div><div><span style="white-space:pre-wrap">                        </span>System.out.println(&quot;Response : &quot; + response);<br><br>Result - <br>

<b>Response : null</b><br></div><br></div></div><div><br></div><div>Could you please help me . Thanks in advance.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Nov 12, 2013 at 7:05 PM, Gary Russell <span dir="ltr">&lt;<a href="mailto:grussell@gopivotal.com" target="_blank">grussell@gopivotal.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">You need to return a result from your listener pojo<div><br></div><div>
<span style="font-family:arial,sans-serif;font-size:13px">public Object handleMessage(String msg) </span></div>
<div><font face="arial, sans-serif"><br>
</font></div><div><font face="arial, sans-serif">or</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">public List&lt;Object&gt; </font><span style="font-family:arial,sans-serif;font-size:13px">handleMessage(String msg) </span></div>


<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">etc.</font></div><div><br></div><div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, Nov 12, 2013 at 3:17 AM, Rajasekhar P <span dir="ltr">&lt;<a href="mailto:sekhar434145@gmail.com" target="_blank">sekhar434145@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr">Hi Russell,<div>
<br></div><div>Thanks for the support. I have followed the documentation am getting response as null. Below is the producer and consumer code.</div>
<div><br></div><div>PRODUCER - </div><div><br>
</div><div><div>// rabbittemplate</div><div><div>public RabbitTemplate rabbitTemplate() {</div><div><span style="white-space:pre-wrap">                </span>RabbitTemplate template = new RabbitTemplate(connectionFactory());</div><div>



<span style="white-space:pre-wrap">                </span>template.setRoutingKey(this.queueName);</div><div><span style="white-space:pre-wrap">                </span>template.setQueue(this.queueName);</div><div><span style="white-space:pre-wrap">                </span>template.setMessageConverter(new JsonMessageConverter());</div>



<div><span style="white-space:pre-wrap">                </span>return template;</div><div><span style="white-space:pre-wrap">        </span>}</div></div><div><br></div></div><div>String msg = &quot;CUSTOMER1&quot;;</div><div><div>Object res = this.rabbitTemplate.convertSendAndReceive(msg);</div>



<div>System.out.println(&quot;Message sent :&quot; +msg);</div><div>System.out.println(&quot;Response : &quot; + res.toString());</div></div><div><br></div><div>CONSUMER - <br></div><div><br></div><div><div><span style="white-space:pre-wrap">                </span>SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();</div>



<div><span style="white-space:pre-wrap">                </span>container.setConnectionFactory(this.connectionFactory);</div><div><span style="white-space:pre-wrap">                </span>container.setQueueNames(this.queueName);</div><div><span style="white-space:pre-wrap">                </span>container.setMessageListener(new <b>MessageListenerAdapter</b>(new TestMessageHandler(this.queueName), new JsonMessageConverter()));</div>



<div><span style="white-space:pre-wrap">                </span>container.start();</div></div><div><br></div><div><br></div><div><div>       // receive messages</div><div><span style="white-space:pre-wrap">        </span>public void handleMessage(String msg) {</div>



<div><span style="white-space:pre-wrap">                </span>System.out.println(&quot;Received  :&quot; + msg);</div><div><span style="white-space:pre-wrap">        </span>} </div></div><div><br></div><div><div><b>Result - </b></div>
<div>Message sent :CUSTOMER1</div><div>java.lang.NullPointerException</div></div><div><br></div><div><br></div><div>Here, inside handleMessage based on message I want get the results from DB and need to send back. Am confusing how set the response to that client(Producer)?</div>



</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">&lt;&lt;snip&gt;&gt;</div></div></blockquote></div></div></div></div>
<br></div></div><div class="im">_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">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>
<br></div></blockquote></div><br></div>
</blockquote></div><br></div>