[ 
https://issues.apache.org/activemq/browse/CAMEL-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58270#action_58270
 ] 

Martin Krasser commented on CAMEL-2549:
---------------------------------------

>> In this (outCapable) case I write it additionally in the header to be 
>> consistent with the (in-only) case. There are 3 possible output values: exit 
>> value, stdout and stderr. In the in-only case both stdout and stderr, as 
>> well as the exit value are set as headers; the in-message is not touched. 
>> Now you know my concerns, what do you think would be most appropriate in 
>> this case?

Also in the in-only case, you should modify the message body. 

>> In this case this would be similar to a call to System.setOut(new 
>> PrintStream(new FileOutputStream("file.output"). What will happens is that 
>> the standart output stream (stdout) will be empty, because nothing will be 
>> written to it. The output is printed namely in the new file stream. In this 
>> case one should define a custom executor and then read the file output 
>> manually.

Not quite. You mean stdout redirection but an executable might well write to 
stdout AND to one or more files. I rather thought about something like 
"exec:myprog?outfile=foo.txt". If an outfile is defined, use it to set the 
message body. Maybe it would make sense to introduce a special data structure 
to be set as message body that contains the data from 0..n output files, stdout 
and stderr data. A special type converter could then do conversions if needed. 
For example, if there's only data from stdout or from a single output file then 
a conversion to a String should be possible.

> Camel Exec component
> --------------------
>
>                 Key: CAMEL-2549
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2549
>             Project: Apache Camel
>          Issue Type: New Feature
>    Affects Versions: 2.3.0
>         Environment: Tested on Windows XP and Linux
>            Reporter: Mitko Kolev
>            Assignee: Martin Krasser
>             Fix For: 2.3.0
>
>         Attachments: camel-exec-patch.diff, camel-exec-patch2.diff
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to