Hi JMS properties get mapped to Camel headers. There is some details here http://camel.apache.org/jms
The stream component will only output the message body. If you use the log component then you can instruct it to output all kind of sorts http://camel.apache.org/log .to("log:foo?showHeaders=true") You can access the message body and headers from the Camel Message instance (org.apache.camel.Message). If you use Java code you can use a java bean, or a Camel Processor to access the message http://camel.apache.org/bean-binding.html http://camel.apache.org/processor On Mon, Jul 11, 2011 at 2:25 PM, dunnlow <[email protected]> wrote: > This seems like it should be easy, but I cannot figure out how to obtain the > properties from a JMS TextMessage. I can obtain the body of the message > with ConvertBodyTo() but I also need the properties. > > I'm using an ActiveMQ (v5.5) TestMessage and setting the properties in a > different java app like, > > TextMessage message = session.createTextMessage(); > message.setStringProperty("status1", status1); > message.setStringProperty("status2", status2); > message.setText(userMessage); > . > . > > To read the Text message off the queue (with Camel 2.7.2) I have a route > like: > > from("activemq:queue:myholdingqueue?testConnectionOnStartup=true").converBodyTo(String.class).to("stream:out"); > > This gives me the text of the message ("userMessage" above) but how do I get > the properties? > > FYI, my end goal is to read those properties, verify the value (in a bean - > posibly changing the names of the properties) then storing the values into a > database. > > Thanks for any insight. > > J > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-use-JMS-TextMessage-Properties-tp4574811p4574811.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
