Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 11116 invoked from network); 27 Feb 2008 06:24:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Feb 2008 06:24:57 -0000 Received: (qmail 4956 invoked by uid 500); 27 Feb 2008 06:24:52 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 4933 invoked by uid 500); 27 Feb 2008 06:24:52 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 4924 invoked by uid 99); 27 Feb 2008 06:24:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 22:24:52 -0800 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Feb 2008 06:24:06 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JUFiM-0003BL-G6 for camel-user@activemq.apache.org; Tue, 26 Feb 2008 22:24:26 -0800 Message-ID: <15706825.post@talk.nabble.com> Date: Tue, 26 Feb 2008 22:24:26 -0800 (PST) From: Kamal To: camel-user@activemq.apache.org Subject: setting JMSXGroupId property from within a processor MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: kamal_gs@yahoo.com X-Virus-Checked: Checked by ClamAV on apache.org 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 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.