I want to watch a directory for incoming files and send their content to a
jms queue.
The first setup I used was the following:
from("file://test").to("jms:test.queue");
from("jms:test.queue").process(new Processor() {
public void process(Exchange exchange) throws Exception {
Object body = exchange.getIn().getBody();
}
});
When I check the body of the message it is only a simple File. That means if
I do this test on two separate machines I cannot get the contents.
Then I read about the converters and tried to use the following:
from("file://test").convertBodyTo(InputStream.class).to("jms:test.queue");
from("jms:test.queue").process(new Processor() {
public void process(Exchange exchange) throws Exception {
Object body = exchange.getIn().getBody();
}
});
Before the message goes to the queue it is an InputStream. But it seems the
JMSEndpoint can“t handle InputStreams. When I check the body of the received
message I get only null.
Can you give me any hints how to set this up? I think this case is quite
common for business use.
Best regards,
Christian
--
View this message in context:
http://www.nabble.com/Problem-with-FileComponent-tp14961883s22882p14961883.html
Sent from the Camel - Users mailing list archive at Nabble.com.