camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mta38 <>
Subject JMS - javax.jms.BytesMessage - Properties can't be retrieved in JmsExchange
Date Mon, 24 Nov 2008 11:43:55 GMT

Hi all,

I have a producer that send BytesMessage object on a queue (ActiveMq is the

Here is the code of producer

BytesMessage message = queueSession.createBytesMessage();

byte[] body = prepareRequestBody();

message.setStringProperty(Constants.MAINCLIENT, "TEST");
QueueReceiver queueConsumer = queueSession.createReceiver(queueResponse);

All here is OK, message is sent to the jms endpoint. But when I explore the
Exchange object in the first processor which deals with the message I can
notice the IN message object have no property.

Following is my processor implementation

public void process(Exchange exchange) throws Exception {
	JmsExchange jmse =(JmsExchange)exchange;
	BytesMessage jmsMsg = (BytesMessage)jmse.getIn();
	String ss = jmsMsg.getStringProperty(Constants.MAINCLIENT);
	System.out.println("PROPERTY ==> "+ss);
	UUID uuid = UUID.randomUUID();	
	exchange.getIn().setHeader(Constants.IDMESSAGE,  uuid.toString());	
catch(Exception ex)

May be there are something wrong in my code but I can't see what :confused:.
Any help are welcome.
Thanks in advance 

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

View raw message