we have one problem statement in our application where we are getting null response at the producer end.
1> Producer will produce message (REQUEST_QUEUE) and it will wait for the response.
Object receivedData = amqpTemplate.convertSendAndReceive("IKEY123456");
System.out.println("RESPONSE DATA: " + receivedData);
2> At consumer end it will consume message and
Class TestConsumer {
AmqpTemplate amqpTemplate;
public void methodA(){
String msg = (String)amqpTemplate.receiveAndConvert()
process(msg);
}
public void process(String msg){
// ... process something on that message
Object resData = service.makeChanges(msg);
// I want to send 'resData" object back to the producer
amqpTemplate.convertAndSend(resData);
}
}
Response at producer end is null. "RESPONSE DATA: null"
Can anyone tell me how to send response back to producer and how to achieve correct response received to the request which we send.