Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
420 views
in Technique[技术] by (71.8m points)

amazon mq - ActiveMQ virtualTopics configuration

In ActiveMQ I can use virtualTopic concept like documented here: http://activemq.apache.org/virtual-destinations.html Its very badly documented by the way.

I have in my activeMQ.xml file this snippit:

<destinationInterceptors>
        <virtualDestinationInterceptor>
          <virtualDestinations>
        <virtualTopic name="TestTopic.>" prefix="VirtualTopicConsumers.*." selectorAware="false"/>
            <compositeQueue name="ESB.TEST1.ALS">
              <forwardTo>
                <queue physicalName="ESB.TEST1.DAT"/>
                <topic physicalName="ESB.TEST1.TOP"/> 
            <topic physicalName="TestTopic.VRT"/>
              </forwardTo>
            </compositeQueue>
          </virtualDestinations>
        </virtualDestinationInterceptor>
      </destinationInterceptors>

What this part says in my opnion: All topics with the name with prefix TestTopic.* for example TestTopic.VRT are virtual topics. When a message is posted on TestTopic.VRT this message will be send to a queue whit a name which has this prefix: VirtualTopicConsumers.*.
For example a queue with the physicalName VirtualTopicConsumers.SystemA. I this interpretation right ?

So when I send a message via the compositeQueue ESB.TEST1.ALS it must be send to topic TestTopic.VRT and this topic has to send it to queue VirtualTopicConsumers.SystemA. What happens is that the compositqueue works correct: message is published to TestTopic.VRT. But the message is NOT send to the VirtualTopicConsumers.SystemA. queue

What I am doing wrong ?

Below my activeMQ.xml file without stuf that has nothing to do with it:

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" advisorySupport="false">
     <destinationInterceptors>
        <virtualDestinationInterceptor>
          <virtualDestinations>
        <virtualTopic name="TestTopic.>" prefix="VirtualTopicConsumers.*." selectorAware="false"/>
            <compositeQueue name="ESB.TEST1.ALS">
              <forwardTo>
                <queue physicalName="ESB.TEST1.DAT"/>
                <topic physicalName="ESB.TEST1.TOP"/> 
            <topic physicalName="TestTopic.VRT"/>
              </forwardTo>
            </compositeQueue>
          </virtualDestinations>
        </virtualDestinationInterceptor>
      </destinationInterceptors>    

<!-- some predefined destinations --> 
    <destinations>
        <queue physicalName="ESB.TEST1.ALS"/>
        <queue physicalName="ESB.TEST1.DAT"/>
        <topic physicalName="ESB.TEST1.TOP"/>
        <topic physicalName="TestTopic.VRT"/>
        <queue physicalName="VirtualTopicConsumers.SystemA."/>
      </destinations>

    </broker>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...