camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From justinblandford <>
Subject How do you build an endpoint string using a JVM argument
Date Fri, 23 Nov 2012 15:10:25 GMT

I have a bean defined as follows:-

<bean id="mq" class="org.apache.activemq.camel.component.MQComponent"
	<property name="connectionFactory" ref="qcf" />

that I use to access a queue connection factory.  So in my camel route the
endpoint looks like:-

<route><to uri="mq:myQueueName">

and this all works fine.  However, I want to externalise the queue
(myQueueName) so that I can provide it as a JVM argument.  I found the
following page:-

which does the trick.  This works if I have the full uri in my JVM argument


and in my camel route I use the PropertiesComponent class to allow me to
access the JVM arg:-

<bean id="properties"
	<property name="cache" value="false" />

so that in my route I use the JVM arg as follows:-

<route><to uri="properties:endpointArg" />.

This also works fine.  However, I don't want to put the bean qualification
"mq:" in my JVM arg as this is a static property that will never change.

So when I take the bean qualification "mq:" out of the JVM arg so that it
looks like :-


and then change my camel route so that it looks like :-

<route><to uri="mq:properties:endpointArg" />.

it doesn't work.

Does anyone have any suggestions on how to get around this?



View this message in context:
Sent from the Camel Development mailing list archive at

View raw message