Hi all,

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

Here is the code of producer

BytesMessage message = queueSession.createBytesMessage();

byte[] body = prepareRequestBody();
message.writeBytes(body);

message.setStringProperty(Constants.MAINCLIENT, "TEST");
                        
                        
queueProducer.send(message);
                        
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 {
try
   {
        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)
{
        exchange.getFault().setBody(ex);
}

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

-- 
View this message in context: 
http://www.nabble.com/JMS---javax.jms.BytesMessage---Properties-can%27t-be-retrieved-in-JmsExchange-tp20659410s22882p20659410.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to