Hi folks,

I've been walking through the documentation, mailing list and Google for a 
while but couldn't get a solution to my problem.

I need to;
1) Use embedded broker
2) Access initial context by providing username(SECURITY_PRINCIPAL) and 
password(SECURITY__CREDENTIALS)
3) Create connections by providing username and password
 
For standalone case, I managed to do 3) by following the instructions[1]. But 
couldn't find a way for 2) either.

Here is the code snippet:

----------------------------------------------
// Server initialization
BrokerService broker = new BrokerService();
broker.addConnector("tcp://localhost:61616");
broker.start();


// Client initialization
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
props.setProperty(Context.PROVIDER_URL,"tcp://localhost:61616");
props.setProperty(Context.SECURITY_PRINCIPAL, "contextUser");
props.setProperty(Context.SECURITY__CREDENTIALS, "contextPassword");

Context jndiContext = new InitialContext(props);
...
Connection connection = connectionFactory.createConnection("connUser", 
"connPassword");
----------------------------------------------


Now, how can I configure embedded broker to make it require contextUser, 
contextPassword, connUser and connPassword?

Any help would be appreciated.

Regards,

Ali Sadik Kumlali


[1] http://www.activemq.org/site/security.html







 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.

Reply via email to