Return-Path:
-from("file://inputdir/").convertBodyTo(String.class).to("jms:test.queue")
-
-By default the file endpoint sends a FileMessage which contains a File object as the body. If you send this directly to the JMS component the JMS message will only contain the File object but not the content. By converting the File to a String, the message will contain the file content which is probably what you want.
- -The route above using Spring DSL:
-- <route> - <from uri="file://inputdir/"/> - <convertBodyTo type="java.lang.String"/> - <to uri="jms:test.queue"/> - </route> --
Camel is of course also able to write files, i.e. produce files. In the sample below we receive some reports on the SEDA queue that we process before they are written to a directory.
-from("file://inputdir/").convertBodyTo(String.class).to("jms:test.queue")
-
-By default the file endpoint sends a FileMessage which contains a File object as the body. If you send this directly to the JMS component the JMS message will only contain the File object but not the content. By converting the File to a String, the message will contain the file content which is probably what you want.
- -The route above using Spring DSL:
-- <route> - <from uri="file://inputdir/"/> - <convertBodyTo type="java.lang.String"/> - <to uri="jms:test.queue"/> - </route> --
Camel is of course also able to write files, i.e. produce files. In the sample below we receive some reports on the SEDA queue that we process before they are written to a directory.
-from("file://inputdir/").convertBodyTo(String.class).to("jms:test.queue")
-
-By default the file endpoint sends a FileMessage which contains a File object as the body. If you send this directly to the JMS component the JMS message will only contain the File object but not the content. By converting the File to a String, the message will contain the file content which is probably what you want.
- -The route above using Spring DSL:
-- <route> - <from uri="file://inputdir/"/> - <convertBodyTo type="java.lang.String"/> - <to uri="jms:test.queue"/> - </route> --
Camel is of course also able to write files, i.e. produce files. In the sample below we receive some reports on the SEDA queue that we process before they are written to a directory.