Hi,

I would like to introduce a mechanism for ActiveMQ which allows me to hide
certain messages for certain users/clients.

The method ServerBroker#setMessageAuthorizationPolicy seems to cover exactly
what I need, but it isn't working for me.

After some Googling arround I found this bug entry (Created 22/Jun/06):
http://issues.apache.org/activemq/browse/AMQ-775

Is this issue accepted as bug? If it is so, is a workaround available for
this?

Otherwise, maybe I did something wrong. Please see my simple snipplet below:

...

BrokerService broker = new BrokerService();
broker.setMessageAuthorizationPolicy(new
SimpleMessageAuthorizationPolicy());
broker.addConnector(this.url);
broker.start();

...

public class SimpleMessageAuthorizationPolicy implements
MessageAuthorizationPolicy {

    public boolean isAllowedToConsume(ConnectionContext connectionContext,
Message message) {
        System.out.println("isAllowedToConsume was called");
        return true;
    }
}

...

The broker starts correctly and I also can send and receive messages, but
the method isAllowedToConsume is never called. Why?

Thank you!

PS: Tried with ActiveMQ 4.1 and 4.2-snapshot

Regards
Stephan

-- 
View this message in context: 
http://www.nabble.com/Broker%3A-setMessageAuthorizationPolicy-is-not-working--tf2711341.html#a7558786
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to