Is there a way to add the ActiveMQ component via javacode in Spring’s applicationConfig XML?
My main goal is to pick up he “brokerURL” from an external property file. But the property file is not a standard property file, its XML based so have to parse it appropriately and get the properties.
<!-- COMPONENT BEANS -->
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
</property>
</bean>
There are several ways.
one is truly programmatic, like this:
given you have a camel context aware bean somewhere to initialize your components.
Otherwise, you could perhaps just wire up the connection factory from elsewhere and have it injected into the XML config on the ActiveMQ component.
Something like this perhaps
then something like this in XML:
Or any other way, since there are multiple ways to wire beans and interact with the Camel Context.