activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <...@exist.com>
Subject Re: How can I enable principle and credentials for embedded broker?
Date Thu, 14 Dec 2006 02:21:12 GMT
I'd try using broker.addPlugins() and instantiate the different broker 
plugins available.

Ali Sadik Kumlali wrote:
> 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.
>
>   


Mime
View raw message