camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From satyanarayana <>
Subject Exchange messagecontainer is getting changed during the process
Date Thu, 03 Jul 2014 13:48:13 GMT
Hi All,

My requirement flow: Asynchronous flow

 a)gets the request  through web service
 b)will push the  request into  queue(activeMQ)
 c) will fetch the message from request queue, send to the external system
 d) external system will take sometime to process and reply back
 e) we have listener , listening to external system 
 f) the listener captures the response and pushing into response queue
 g) external system has provided API (external system jars) for
communication from our system
* After fetching message from response queue, what i found is the exchange
message container is changed since exchange id is different. hence the
header properties what i set initially are missing and my security
interceptors is throwing exception and unable to proceed. *

below is the code what  i am using while pushing the message into

import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.Session;

public void sendJMSMessage(final String msgType,final Serializable
msgObject) throws Exception {
		jmsTemplate.send(new MessageCreator() {
			public Message createMessage(Session session)
					throws JMSException {
				Message message = null;
				if (msgType.equals("String")) {
					message = session.createTextMessage(msgObject
				} else if (msgType.equals("Object")) {
					message = session.createObjectMessage(msgObject);"Object message is created");
				} else if (msgType.equals("Bytes")) {
					byte[] bytes = msgObject.toString().getBytes();
					BytesMessage byteMessage = session.createBytesMessage();
					message = byteMessage;
				} else {"ERROR Invalid message type:" + msgType);
				return message;

Can you please let me know the solution for the above issue.

View this message in context:
Sent from the Camel Development mailing list archive at

View raw message