You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2011/02/16 21:44:24 UTC

[jira] Closed: (AMQ-3155) Bad conversion from stomp topic to activeMQ topic

     [ https://issues.apache.org/jira/browse/AMQ-3155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish closed AMQ-3155.
-----------------------------

    Resolution: Won't Fix
      Assignee: Timothy Bish

The code is working as designed, you should create the topic using "/topic/subject.hello" if you want the behaviour you have described.

> Bad conversion from stomp topic to activeMQ topic
> -------------------------------------------------
>
>                 Key: AMQ-3155
>                 URL: https://issues.apache.org/jira/browse/AMQ-3155
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.4.2
>         Environment: Win7 64bits, jre 1.6.0_23
>            Reporter: Michael Barroco
>            Assignee: Timothy Bish
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> 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:
> <i>
> 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 = correctStompTopic(messageSend.getDestination());
>     	messageSend.setDestination(dest);
>         super.send(producerExchange, messageSend);
>     }
>     public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception{
>     	ActiveMQDestination dest = correctStompTopic(info.getDestination());
>     	info.setDestination(dest);
>     	return super.addConsumer(context, info);
>     }
>     public ActiveMQDestination correctStompTopic(ActiveMQDestination destination){
>     	String aqdest = destination.getPhysicalName().replace('/', '.');
>     	destination.setPhysicalName(aqdest);
>     	return destination;
>     }
> }
> </i>
> I hope it could be interesting.
> Best regards
> michael

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira