You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by raippl <pi...@gmail.com> on 2016/04/28 16:05:02 UTC

Camel setBody from file (runtime loading)

Hi guys,
I wrote a camel route that each "PERIOD" execute a java program, than at the
end of this program a would like to read the output of the program
(file.log) and write it to my camel log file.
The problem is that I'm not able to read the file at runtime, each time te
route start (PERIOD) I have always the same initial content of the body in
my log file, even if the program is called and the file.log changes. 
Here is my route:

<route id="route4" startupOrder="4" autoStartup="false"
routePolicyRef="myStartPolicy">
            <from uri="timer://foo?fixedRate=true&amp;period={{PERIOD}}"/>
	    <to uri="exec:{{EXEC}}"/>
		<onCompletion onCompleteOnly="true">
			<camel:setBody>
				<camel:simple
resultType="java.lang.String">resource:file:///C:/Entratel/prog/file.log</camel:simple>
			</camel:setBody>
			<camel:log message="******************************************"/>
			<camel:log message="[ROUTE-4] file content: ${body}"/>
			<camel:log message="********************************************"/>
	    </onCompletion>
	    <onException useOriginalMessage="true">
      	    </onException>
</route>

Any idea? I can I read a file at runtime?
Thanks in advance.

PPL



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-setBody-from-file-runtime-loading-tp5781891.html
Sent from the Camel Development mailing list archive at Nabble.com.

AW: Camel setBody from file (runtime loading)

Posted by "Walzer, Thomas" <th...@integratix.net>.
Hi,

your question should go to the users@camel.apache.org.

Cheers, Thomas.


-----Ursprüngliche Nachricht-----
Von: raippl [mailto:pierpaolo.rai@gmail.com] 
Gesendet: Donnerstag, 28. April 2016 16:05
An: dev@camel.apache.org
Betreff: Camel setBody from file (runtime loading)

Hi guys,
I wrote a camel route that each "PERIOD" execute a java program, than at the end of this program a would like to read the output of the program
(file.log) and write it to my camel log file.
The problem is that I'm not able to read the file at runtime, each time te route start (PERIOD) I have always the same initial content of the body in my log file, even if the program is called and the file.log changes. 
Here is my route:

<route id="route4" startupOrder="4" autoStartup="false"
routePolicyRef="myStartPolicy">
            <from uri="timer://foo?fixedRate=true&amp;period={{PERIOD}}"/>
	    <to uri="exec:{{EXEC}}"/>
		<onCompletion onCompleteOnly="true">
			<camel:setBody>
				<camel:simple
resultType="java.lang.String">resource:file:///C:/Entratel/prog/file.log</camel:simple>
			</camel:setBody>
			<camel:log message="******************************************"/>
			<camel:log message="[ROUTE-4] file content: ${body}"/>
			<camel:log message="********************************************"/>
	    </onCompletion>
	    <onException useOriginalMessage="true">
      	    </onException>
</route>

Any idea? I can I read a file at runtime?
Thanks in advance.

PPL



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-setBody-from-file-runtime-loading-tp5781891.html
Sent from the Camel Development mailing list archive at Nabble.com.