camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier.Roger" <>
Subject [Camel-exec] dynamic parameters in Spring DSL
Date Thu, 21 Oct 2010 08:24:02 GMT


I am using Camel version 2.4 for the new Camel-exec component.

I would like to ask your opinion on this potential improvement for the usage
of this component with Spring DSL. To use dynamic parameters the
CamelExecCommandArgs header has to be set with a Java List object.

This of course requires Java code to create (simple of course, but still).
Would it not more user friendly if it a String could be given instead/also ?
In that case a separator would be necessary but I guess a blank space could
be the default value.

This way instead of doing 

            <setHeader headerName="execArgs">

            <setHeader headerName="CamelExecCommandArgs">
                <method bean="helper" method="parseArgs"/>

    <bean id="helper" class="CamelExecHelper">
         <property name="argsHeader" value="execArgs" />
         <property name="argsSeparator" value="," /> <!-- optional -->

This could be writtent 

            <!-- optional -->
            <setHeader headerName="CamelExecCommandArgs">

            <setHeader headerName="CamelExecCommandArgs">
                <simple>arg1,arg2,arg3</simple> <!-- of course simple offers
many more advance possibilities -->

The bean code is very simple indeed but is required 

    public List<String> parseArgs(@Header(field) String argsHeader){
        List<String> args = new ArrayList<String>();

        return args;        

But maybe I am not seeing an easier way already applicable with the current
version. In that case, please tell me.
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message