activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Prokopiev <>
Subject Re: Security and restricting access
Date Thu, 10 Aug 2006 17:58:26 GMT
> Some specific explaination, per your code would be nice.  Like what steps you
> are doing, and how it works with the ActiveMQ plugin model.  I've never used
> Spring.  I've never used a plugin.  I understand fundamental core Java,
> period.  
> The basic security model I was envisioning using was to have the topic/queue
> names include a UUID...if one doesn't know the queue name, including UUID,
> then one can't access the queue.    The client is C++.  The backend logic,
> per my project, is done with JAVA Servlets/Struts, and a set of tables in a
> As I stated originally, I want to be able to only have a few "entities",
> authenticated by Username and Password, be able to Create and Destroy Topics
> and Queues.  Either manually or programmatically.
> For example how could I set ActiveMQ up so that only two specific usernames
> and passwords would give topic/queue create/destroy access? 

You need to write you own class extends BrokerPluginSupport class. Such 
classes defined as plugins for ActiveMQ broker will intercept all events 
in broker lifecycle, so you can read event parameters (username and 
password for example) and allow this event by calling super. or restrict 
them by raising exception.

For defining plugins for ActiveMQ broker you need read more about 
ActiveMQ xml configuration in

Next you need to select raw Spring or XBeans Spring configuration 
manner. In first case you can write this simple configuration:

<?xml version="1.0" encoding="UTF-8"?>
	<bean id="broker" class="" 
init-method="start" destroy-method="stop">
                 <property name="brokerName" value="m0"/>
                 <property name="persistent" value="true"/>
                 <property name="transportConnectorURIs">
                 <property name="plugins">
                                 <bean class="SimplePlugin"/>

For starting this configuration (it can be named "context" by Spring 
users) you need to write and run this class:


public class Startup {

         public static void main(String[] args) throws 
InterruptedException {

                 AbstractApplicationContext ctx =
                         new FileSystemXmlApplicationContext(new String 


So, broker will work until pressing Ctl+C

Also you need to write class SimplePlugin extends BrokerPluginSupport 
and overrides some of it's methods.

XBeans Spring configuration is used by default and in this case you 
don't need write you own Startup class and can use In this case plugins connecting described in

View raw message