This problem has been fixed (see
https://issues.apache.org/activemq/browse/CAMEL-299). If you want to use
the convertBodyTo method in Spring DSL anyway, try this:
<route>
<from uri="file:..."/>
<convertBodyTo type="java.lang.String"/>
<to uri="jms:test.queue"/>
</route>
harpritt wrote:
Hi James
ive had a look around but cant seem to find any information on the
equivellent solution using XML.
im very new to this so appologies if i asked a dum question
Kind regards
James.Strachan wrote:
On 18/01/2008, Christian Schneider <[EMAIL PROTECTED]> wrote:
I just found a solution by using:
from(SOURCE).convertBodyTo(String.class).to("jms:test.queue");
from("jms:test.queue").process(new Processor() {
public void process(Exchange exchange) throws Exception {
Object body = exchange.getIn().getBody();
}
});
Is this the correct way to do this?
Currently yes. One of the problems with Camel components is that they
often have to deal with any type of Object as the payload. Right now
the JMS binding tries to do the right thing; if the payload is a
String it uses a TextMessage otherwise it uses an ObjectMessage.
We should probably improve the type support in the JMS binding to deal
nicer with File objects.
Though given a File object, normally the binding would have to use a
BytesMessage as it would not be sure the file is actually text; so if
you really want to send a TextMessage then I'd recommend leaving your
"convertBodyTo(String.class)" in the DSL
I've raised a JIRA to track this issue...
https://issues.apache.org/activemq/browse/CAMEL-299
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com