 <p>I'm no expert in ActiveMQ, but I'm one of the developers of the HiveMQ MQTT broker, which is also written in Java. We have an OpenSource Plugin SDK, which allows to customize the authentication of clients and the authorization of clients to publish/subscribe to the broker. You can use a relational database or any other kind of service that is accessable from within Java to determine if a certain client is allowed to publish or subscribe to a topic. Clients can be restricted by topic, activity (publish/subscribe) and QoS.</p> <p>More information how it works can be found in the HiveMQ Plugin developers guide [1] [2].</p> <p>Cheers, Chris</p> <p>[1] <a href="http://www.hivemq.com/docs/plugins/1.4.0/#auth-permission-chapter" rel="nofollow">http://www.hivemq.com/docs/plugins/1.4.0/#auth-permission-chapter</a></p> <p>[2] <a href="http://www.hivemq.com/docs/plugins/1.4.0/#client-authorization-chapter" rel="nofollow">http://www.hivemq.com/docs/plugins/1.4.0/#client-authorization-chapter</a></p>