Hi, I would like to suggest the following modification for the Camel ActiveMq Component in order to allow camel (deployed top of an OSGI server like ServiceMix 4) to call an already installed ActiveMq broker.
To use ActiveMq from Camel, the following bean must be instantiated by spring : <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="brokerURL" value="vm://localhost:61616" /> </bean> This component is a kind of gateway who will proxy communication between the camel routes and the broker. If the instance of the broker does not exist (= is not started), then camel will instantiate it To tell to the component that it should not create an instance of activemq (because the broker has been started separately from this camel context as this is possible in SMX4), you must change the property of the url like this : <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="brokerURL" value="vm://localhost:61616?create=false" /> </bean> To avoid confusion for the user, I propose that we have a new property that we will use to inform the component if the broker already runs or not : <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="brokerURL" value="vm://localhost:61616" /> <property name="runSeparately" value="true" /> </bean> The second modification that I propose concerns deployment of Camel top of an osgi server. In this case, I need your help because I'm not sure at 100% about what I will say If my camel routes are deployed in an osgi bundle and have reference in the from or to uri to activemq, How camel will be able to find activemq : 1) through the brokerUrl OR 2) by passing the OSGI reference of the service who has instantiating activemq If we adopt the second strategy, the bean can be described like this ... <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="brokerURL"/> --> it this case, it makes no sense to use the brokerUrl <property name="osgiReference" value="#activemqservice" /> </bean> ... Maybe, we could simplify the syntax by removing this bean creation from the camel context in order to pass directly the osgi reference of the service in the route like <camel:from uri="osgiref=activemq:queue:in" /> In this case, camel will create the bean org.apache.activemq.camel.component.ActiveMQComponent and find the activemq broker using the osgi reference of the service Regards, ----- Charles Moulliard SOA Architect My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ -- View this message in context: http://www.nabble.com/Suggestion-%3A-Modification-of-the-Camel-ActiveMq-Component-tp22493057p22493057.html Sent from the Camel - Users mailing list archive at Nabble.com.