Can I map composite topic to virtual topic

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I map composite topic to virtual topic

Soupdragon
This post has NOT been accepted by the mailing list yet.
I'm changing a set up to replace durable subscriptions with Virtual Topics. I've been experimenting with trying to map the old topic names to virtual topics, so that I don't have to track down every program which might write to an existing topic.

        <destinationInterceptors>
            <virtualDestinationInterceptor>
                <virtualDestinations>
                    <compositeTopic name="OCS_LOG" forwardOnly="false">
                        <forwardTo>
                            <topic physicalName="VirtualTopic.OCS_LOG"/>
                        </forwardTo>
                    </compositeTopic>
                    <compositeTopic name="OCS_RELAYED" forwardOnly="false">
                        <forwardTo>
                            <topic physicalName="VirtualTopic.OCS_RELAYED"/>
                        </forwardTo>
                    </compositeTopic>
                </virtualDestinations>
            </virtualDestinationInterceptor>
        </destinationInterceptors>

When I set up a consumer for VirtualTopic.OCS_LOG messages published to OCS_LOG are transferred as expected, but setting up a queue consumer on Consumer.bb.VirtualTopic.OCS_LOG gets no messages.

Reply | Threaded
Open this post in threaded view
|

Re: Can I map composite topic to virtual topic

ncasaux
Hello,

After some search, I think I managed to do what you describe.
The only difference I see is that I had to re-specify the default value for
name and prefix of virtualtopics:

<virtualTopic name="VirtualTopic.>" prefix="Consumer.*."
selectorAware="false"/>

in the <virtualDestinations> block.

Example:

        <destinations>
                <topic physicalName="VirtualTopic.orders" />
                <queue physicalName="Consumer.A.VirtualTopic.orders" />
                <queue physicalName="Consumer.B.VirtualTopic.orders" />
                <queue physicalName="Consumer.C.VirtualTopic.orders" />
        </destinations>

        <destinationInterceptors>
                <virtualDestinationInterceptor>
                        <virtualDestinations>
                                <virtualTopic name="VirtualTopic.>" prefix="Consumer.*."
selectorAware="false"/>
                                <compositeQueue name="Consumer.C.VirtualTopic.orders">
                                        <forwardTo>
                                                <topic physicalName="Topic.C" />
                                                <queue physicalName="Queue.C" />
                                        </forwardTo>
                                </compositeQueue>
                        </virtualDestinations>
                </virtualDestinationInterceptor>
        </destinationInterceptors>




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