camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dunnlow <>
Subject Re: How to use JMS TextMessage Properties?
Date Mon, 11 Jul 2011 13:05:49 GMT
Thanks for the reply (your book has been a HUGE help btw).

Sorry, I am still missing something.  I understand your comment about the
stream component, which clears up one question.  However, I tried passing
the message to a bean, as:


my bean is defined via Spring XML:
<bean id="myCamelBean" class="com.mycc.beans.MyCamelBean"/>

and the actual class just has one method:

public String toSql(Object obj){
   System.out.println("class is "+obj.getClass().getName());
   if (obj.getClass().getName().equals("java.lang.String")){
      String sre = (String) obj;
      String.out.println("string is ["+str+"]");

What I end up seeing on system.out is 
"class is java.lang.String"
"string is [Hello this is the text in my TextMessage]"

My question:

1) If I leave the "ConvertBodyTo()" out of the route, the bean never seems
to be called. Why is that?

2) I was expecting that my bean would get some sort of message object from
which I could call a getProperty, but it only gets a string with the header
(with the ConvertBodyTo).  Is there something else I should be using to get
the message to my Bean?

Thanks again.

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

View raw message