activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From barroco <>
Subject Stomp Topic
Date Tue, 25 Jan 2011 07:13:46 GMT


>From several days, I'm working on the authentication and authorization
topics for a stomp process. I identified a strange behavior. The topics with
sub destinations (ie: /topic/subject/hello ) didn't seemed to be handled by
a virtual topic rule (ie: sub1.> ).

It seems that the stomp topic is not properly converted by when it is
handled by ActiveMQ and the topic ( /topic/subject/hello ) is considered as
"topic://subject/hello" and not as "topic://subject.hello"

So i implemented an authorization broker to correct it in some cases (maybe

public class MyAuthorizationBroker extends AuthorizationBroker {

	public MyAuthorizationBroker(Broker next,
			AuthorizationMap authorizationMap) {
		super(next, authorizationMap);
    public void send(ProducerBrokerExchange producerExchange, Message
messageSend) throws Exception {
    	ActiveMQDestination dest =
        super.send(producerExchange, messageSend);
    public Subscription addConsumer(ConnectionContext context, ConsumerInfo
info) throws Exception{
    	ActiveMQDestination dest = correctStompTopic(info.getDestination());
    	return super.addConsumer(context, info);
    public ActiveMQDestination correctStompTopic(ActiveMQDestination
    	String aqdest = destination.getPhysicalName().replace('/', '.');
    	return destination;

For my project, it seems to work, I hope this could be helpfull and I'm very
interested if somebody find a best way to do it.

Best regards


PS: I created a new issue
View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message