activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yari <>
Subject ActiveMQ & Camel
Date Tue, 08 Jul 2008 10:46:45 GMT

Hi everyone,
i started working on ActiveMQ for a few days and i wanna share an experience
i found out to be interesting (and could save a lot of time) to other
people.The project i work on required JAAS, for authentication and
authorization, as well as Camel, in order to integrate Enterprise
Integration Patterns. We decided to start building what we need with a
simple content based router using the EL scripting language.

So the first thing was to download the camel-juel jar from 
and saved in the activemq lib/ directory.

Then we edited the activemq.xml configuration with:

	<camelContext id="camel"
	            <from uri="activemq:QUEUE.FOO"/>
                        	<el>${in.headers['TESTHEADER'] == 'TEST' }</el>
                        	<to uri="activemq:QUEUE.BAR"/>
                        	<to uri="activemq:QUEUE.BUZZ"/>

and we tried starting the broker, and everything was fine, the routing was
able to dispatch to the correct queue based on headers (so messages with
TESTHEADER equals to TEST were dispatched to QUEUE.BAR, everything else to

We then tried to enable JAAS authentication and authorization with:

  <jaasAuthenticationPlugin configuration="activemq-domain" /> 

setting everything up like explained in
When we tried to start the broker we end up with:

java.lang.SecurityException: User name or password is invalid
(and a bunch of stack traces)

After a lot of work we were able to understand that, when Camel is started
it tries to connect to the broker in order to create queues and topic
required for routing (in the above example to create QUEUE.FOO,
QUEUE.BAR,QUEUE.BUZZ). Obviously, since there's an authorization required to
access the broker, and you can't provide Camel with a username and a
password (or at least we weren't able to find a way to do that), it cannot
authenticate and so it cannot do anything 

Just to save some work to some of you, remember that you cannot provide
Camel with connection informations as well, so, for example, if you have a
machine with an IP and you change:

	        <transportConnector name="openwire" 	uri="tcp://localhost:61616" 

,which will bind your broker to both and, to

	        <transportConnector name="openwire" 	uri="tcp://"  

Camel won't work as well, because it won't be able to connect to the broker,
so it won't be able to install routes.

So we ended up disabling JAAS plugin, in order to be able to use Camel. Now
i have some questions:

1) Is there any way to pass a username and a password to Camel? and if it
isn't, is there any plan to implement such feature? 
2) why is Camel using a TCP connection instead of direct methods invocation?
3) is there any documentation about this problem which maybe i missed?

best regards,
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message