1
votes

does anybody know how to restrict access to jms destinations in activemq programmtically?
I got a client-server application and i want to use a destination for each client to send messages to the server.

At the activemq website (http://activemq.apache.org/security.html) there is a short Authentication Example but that is using xml config files.

I need to do it programmatically at runtime.
-> create a destination and restrict read/write access to a certain user

is this possible? can anybody give me a hint?

thanks!

1

1 Answers

1
votes

You can restrict access programmatically using ActiveMQ Interceptors.

Extend BrokerPlugin to override addConsumer or addProducer methods. A destination is stored in the ConsumerInfo/ProducerInfo method's argument respectively. You can throw an Exception while handling event to reject user from establishing consumer/producer to this destination. Then add your new plugin to the broker configuration as it's described in link above.