This is the config I got working using the latest snapshot of ActiveMQ 4.1:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util">
<!-- Allows us to use system properties as variables in this
configuration file -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker persistent="false" brokerName="localhost" useJmx="true"
xmlns="http://activemq.org/config/1.0">
<plugins>
<simpleAuthenticationPlugin userGroups="#groups"
userPasswords="#users"/>
</plugins>
<!-- disabled the commandAgent first -->
<services>
</services>
.....
</broker>
<util:map id="users">
<entry key="user1" value="password1"/>
</util:map>
<util:map id="groups">
<entry key="user1">
<ref bean="group1"/>
</entry>
</util:map>
<util:set id="group1">
</util:set>
Wonder why ActiveMQ does not allow the SimpleAuthenticationPlugin to use
a null usersGroup....
Chris Hofstaedter wrote:
Hi,
I've taken a look on the user groups and some general searching, but I'm
not finding much in the way of examples on setting up a
SimpleAuthenticationPlugIn. I'm sure my issue stems from bad
configuration, but I'm having a heck of a time figuring it out.
The symptom is that SimpleAuthenticationPlugIn.setUserGroups is being
invoked with a map that has no entries in it.
My xml file looks like this:
<beans xmlns="http://activemq.org/config/1.0">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfi
gurer"/>
<broker name="localhost" useJmx="true">
<managementContext>
<managementContext connectorPort="1099"
jmxDomainName="org.apache.activemq"/>
</managementContext>
<plugins>
<simpleAuthenticationPlugin userGroups="#groups"
userPasswords="#users"/>
</plugins>
<persistenceAdapter>
<journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.home}/activemq-data"/>
</persistenceAdapter>
<transportConnectors>
<transportConnector name="default"
uri="tcp://localhost:61616"/>
</transportConnectors>
</broker>
<bean id="users" class="java.util.HashMap">
<map>
<entry key="user1" value="user1"/>
</map>
</bean>
<bean id="groups" class="java.util.HashMap">
<map>
<entry key="user1" value="password1"/>
</map>
</bean>
</beans>
Anyone see where my mistake is?