git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get topic in activemq 5.15.4


Dear all, 

I have just upgrade activemq 5.12.0 to 5.15.4, but have a problem with my
jms client code (using library activemq client) 

In activemq.xml, I configure virtual destination topic as below: 
                <destinationInterceptors>
                        <virtualDestinationInterceptor>
                                <virtualDestinations>
                                        <virtualTopic name=">"
prefix="VirtualTopic.*." selectorAware="false"/> 
                                </virtualDestinations>
                        </virtualDestinationInterceptor>
                </destinationInterceptors>
And in a mqtt client, I sent a message to topic test.data.xxxxx.01 (where
xxxxx using to identify unique client). 
In a JMS client, I configure for receive message: 
@MessageDriven(activationConfig = { 
    @ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"), 
    @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"), 
    @ActivationConfigProperty(propertyName = "destination", propertyValue =
VirtualTopic.A.test.data.>") 
}) 

In JMS client code, I want to get topic of received message
(test.data.xxxxx.01): 
    @Override 
    public void onMessage(Message message) { 
             ActiveMQBytesMessage mqtt = (ActiveMQBytesMessage) message; 
            String topicStr = mqtt.getDestination(); 
            .................... 
   } 
When JMS client connects to ActiveMQ 5.12.0, the topicStr =
"test.data.xxxxx.01" 
When JMS client connects to ActiveMQ 5.15.4, the topicStr =
"VirtualTopic.A.test.data.>" 

My question is How do I configure in activemq.xml of ActiveMQ 5.15.4 then
JMS client can get topicStr = "test.data.xxxxx.01", I don't want to change
my JMS client code after upgrade ActiveMQ. 

Please help me, thanks! 




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html