Just built a workaround...using a dummy exec with no args, but setting both
the executable and the args via de proper header prior to endpoint
invocation, that way I finally DO GET the correct output headers, with the
flexibility of a dynamic URL.

Spring DSL:

                                <camel:setHeader 
headerName="CamelExecCommandExecutable">
                                        
<camel:simple>{{cmod.arsLoad}}</camel:simple>
                                </camel:setHeader>
                                <camel:setHeader 
headerName="CamelExecCommandArgs">
                                        <camel:simple>-f -g 
${in.header.appGroup} -h {{cmod.host}} -u
{{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id}</camel:simple>
                                </camel:setHeader>
                                <camel:to uri="exec://dummy" />
                                <camel:to
                                        
uri="log:org.apache.camel.example?showAll=true&amp;multiline=true" />
                                <camel:log message="Error code: 
${in.header.CamelExecExitValue}" />

Output / log example:

[14/08/14 18:35:06:177 CLT] 0000007d SystemOut     O 2014-08-14 18:35:06,177
ERROR [ExecProducer             ] - The command ExecCommand [args=[-f, -g,
FONDO, -h, 192.168.10.245, -u, admin, -p, password,
/tmp/ID-thor-altiuz-cl-51959-1408055697500-0-1],
executable=/opt/ibm/ondemand/V9.0/bin/arsload, timeout=9223372036854775807,
outFile=null, workingDir=null, useStderrOnEmptyStdout=false] returned exit
value 11
[14/08/14 18:35:06:179 CLT] 0000007d SystemOut     O 2014-08-14 18:35:06,179
INFO  [example                  ] - Exchange[
, Id: ID-thor-altiuz-cl-51959-1408055697500-0-7
, ExchangePattern: InOptionalOut
, Properties: {CamelCorrelationId=ID-thor-altiuz-cl-51959-1408055697500-0-2,
CamelCreatedTimestamp=Thu Aug 14 18:35:05 CLT 2014,
CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=multicast1],
DefaultMessageHistory[routeId=route1, node=to3],
DefaultMessageHistory[routeId=route4, node=to6],
DefaultMessageHistory[routeId=route4, node=setHeader3],
DefaultMessageHistory[routeId=route4, node=doTry1],
DefaultMessageHistory[routeId=route4, node=setHeader4],
DefaultMessageHistory[routeId=route4, node=setHeader5],
DefaultMessageHistory[routeId=route4, node=to7],
DefaultMessageHistory[routeId=route4, node=to8]],
CamelMulticastComplete=true, CamelMulticastIndex=2,
CamelToEndpoint=log://org.apache.camel.example?multiline=true&showAll=true,
isXalanTransformer=false, TryRouteBlock=true}
, Headers: {appGroup=FONDO,
breadcrumbId=ID-thor-altiuz-cl-51959-1408055697500-0-1,
CamelExecExitValue=11, CamelExecStderr=null,
CamelSpringWebserviceSoapHeader=javax.xml.transform.dom.DOMSource@492082f4}
, BodyType: org.apache.camel.component.exec.ExecResult
, Body: ARS1609W Specifying passwords on the command line is insecure due to
the text being visible. See the Installation and Configuration Guide for
your platform for information about the arsstash command or using Unified
Login.ARS4315I Processing file
>/tmp/ID-thor-altiuz-cl-51959-1408055697500-0-1<ARS1110E The application
group >FONDO< does not exist or user >admin< does not have permission to
access the application groupARS4318E Processing failed for file
>/tmp/ID-thor-altiuz-cl-51959-1408055697500-0-1<Processing has stopped.  The
remaining files will NOT be processed.
, Out: null: 
]
[14/08/14 18:35:06:179 CLT] 0000007d SystemOut     O 2014-08-14 18:35:06,179
INFO  [route4                   ] - Error code: 11



--
View this message in context: 
http://camel.465427.n5.nabble.com/Exec-endpoint-not-working-correctly-with-recipientList-tp5755229p5755236.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to