This content has been marked as final.
Show 4 replies
-
1. Re: Camel ReplyTo ActiveMQ
davsclaus Oct 28, 2011 4:45 AM (in response to michal.warecki)Camel should send back the reply message if a JMSReplyTo header is given, and that there is a message body to send back.
-
2. Re: Camel ReplyTo ActiveMQ
michal.warecki Oct 30, 2011 4:00 PM (in response to davsclaus)So there is something wrong with this.
I'm manipulating only "in" message and there is some body (java object) and headers:
{JMSReplyTo=temp-queue://ID:MichalPC-54890-1320002952266-0:1:10, JMSCorrelationID=null, JMSExpiration=0, JMSTimestamp=1320003959180, JMSType=null, JMSRedelivered=false, JMSMessageID=ID:MichalPC-54890-1320002952266-0:1:3:1:10, JMSPriority=4, JMSDeliveryMode=2, JMSDestination=queue://InvokeService, JMSXGroupID=null, CamelBeanMethodName=invokeService}
Maybe JMSCorrelationID is wrong?
Client code:
public Serializable sendAndReceive(final Serializable message, final String queueName, final Map<String, String> properties) { Serializable reply = (Serializable) jmsTemplate.execute(new ProducerCallback<Object>() { public Object doInJms(Session session, MessageProducer producer) throws JMSException { TemporaryQueue queue = session.createTemporaryQueue(); ObjectMessage objectMessage = session.createObjectMessage(); objectMessage.setObject(message); objectMessage.setJMSReplyTo(queue); Set<String> keySet = properties.keySet(); for(String key : keySet) { objectMessage.setStringProperty(key, properties.get(key)); } producer.send(session.createQueue(queueName), objectMessage); return session.createConsumer(queue).receive(30000); } }); return reply; }
After 30 second there is timeout with null reply value.
Any suggestions what I'm doing wrong? Thx
-
3. Re: Camel ReplyTo ActiveMQ
davsclaus Oct 31, 2011 2:56 AM (in response to michal.warecki)You have configured the message type as a Map, but you send an Object from the client. I would assume they need to match.
-
4. Re: Camel ReplyTo ActiveMQ
michal.warecki Oct 31, 2011 5:03 PM (in response to davsclaus)Yes, you are right. I am really grateful for your help