camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamal <kamal...@yahoo.com>
Subject setting JMSXGroupId property from within a processor
Date Wed, 27 Feb 2008 06:24:26 GMT

I am trying to set the JMXGroupId property from within a processor using the
following code.  
exchange.getOut().setHeader("JMSXGroupID",groupId);
which doesn't work.

I also tried to get hold of the underlying JMSMessage by casting the Message
object, but the underlying JMS message object is null. 
		Message outMessage = exchange.getOut();
		JmsMessage jmsOutMessage = (JmsMessage) outMessage;
		javax.jms.Message underlyingMessage = jmsOutMessage.getJmsMessage();
		System.out.println("underlyingMessage" + underlyingMessage);

The requirement is to extract information from the message and set it as a
JMSXGroupID.  We don't have control over the producer.  We are using
ActiveMQ, with Camel embedded within the broker.  

The following is my camel context configuration
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
	  <route>
	        <from uri="activemq:testQ-input"/>
		<process ref="groupIdInsertionProcessor"/>
		<to uri="activemq:testQ-output"/>
	  </route>
</camelContext>

<bean id="groupIdInsertionProcessor" class="xx.GroupIdInsertionProcessor"/>

public class GroupIdInsertionProcessor implements Processor {
	public void process(Exchange exchange) throws Exception {
		Message inMessage = exchange.getIn();
		exchange.getOut().setHeader("JMSXGroupID",inMessage.getBody());
	}
}


Thanks for the help.

Regards,
Kamal
-- 
View this message in context: http://www.nabble.com/setting-JMSXGroupId-property-from-within-a-processor-tp15706825s22882p15706825.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message