Skip to content

A simple auth plugin for ActiveMQ that serves as a template for developing authentication plugin

Notifications You must be signed in to change notification settings

kenliao94/activemq-auth-plugin-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ActiveMQ Authentication Plugin template

This repo is a template for developing your ActiveMQ authentication plugin.

Its main purpose is to define the bare minimum dependencies and steps to add it to your ActiveMQ installation.

This simple authentication plugin authenticates using username and password

Step 1. Build the plugin jar

mvn package

Step 2. Move the packaged jar to the activemq lib

  • Download ActiveMQ 6.x here
  • Unzip the tarball or zip file you just downloaded. For example, unzip ~/Downloads/apache-activemq-6.1.5-bin.zip
  • Copy the built jar in the lib sub-folder of the installation. For examplecp ./target/activemq-plugin-1.0-SNAPSHOT.jar ~/Downloads/apache-activemq-6.1.5/lib/
  • Add the plugin to activemq.xml
<plugins>
    <bean xmlns="http://www.springframework.org/schema/beans" id="sampleAuthPlugin" class="com.activemq.auth.plugin.SampleAuthenticationPlugin">
        <property name="users">
            <list>
                <bean class="org.apache.activemq.security.AuthenticationUser">
                    <constructor-arg value="your-username"/>  <!-- Username -->
                    <constructor-arg value="your-password"/>  <!-- Password -->
                    <constructor-arg value="your-group"/>  <!-- Groups (comma-separated) -->
                </bean>
            </list>
        </property>
    </bean>
</plugins>

Step 3. Start the ActiveMQ broker

$ cd ~/Downloads/apache-activemq-6.1.5/
$ ./bin/activemq console 

Step 4. Trying sending a message to the broker with the configured username and password

$ ./bin/activemq producer --brokerUrl "tcp://localhost:61616" --user $username --password $password --destination queue://tq --message 10 --messageSize 100

About

A simple auth plugin for ActiveMQ that serves as a template for developing authentication plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages