I have some Apache Camel routes with many options, like this one:
<from uri="sftp://user@host:22/path?
password=vvvvv;delay=3000&streamDownload=true&
delete=true&idempotent=true&idempotentRepository=#jpaStore&
inProgressRepository=#jpaStore"/>
This isn't so bad, but I have six other routes with the same options but different paths. I'd like to put all the options in a constant to avoid duplication:
<from uri="sftp://user@host:22/path?OPTIONS"/>
I might be able to use Camel EL to accomplish this, but none of the examples show it, and my attempts to guess the syntax aren't working.
I create a Spring bean like this:
<bean id="myoptions" class="java.lang.String">
<constructor-arg value="allmyoptions"/>
</bean>
And try to refer to it like this:
<from uri="sftp://user@host:22/path?${myoptions}"/>
But I get an error:
There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{${myoptions}=}]
This question, Simple Expression in apache-camel uri, is attempting something similar, but they use Java DSL and my routes are configured in XML.
Does anyone know a good way to avoid duplicating all this options across routes?