0
votes

I'm publishing a message to a virtual topic named VirtualTopic.Orders (through the spring-jms). I publish the message to ActiveMQ without any problem and I can see the message in the VirtualTopic.Orders queue, but I can't consume it. Here is my JmsTemplate bean declaration:

<bean id="jmsTemplateBusinessEvents" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="pubSubDomain" value="true"/>
</bean>

I have set pubSubDomain as true because of this explanation.

I also changed the configuration file activemq.xml as explained here:

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

And here is my consumer pointing to the Consumer.A.VirtualTopic.Orders queue:

<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer" init-method="start"
          lazy-init="false">
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
    <property name="destinationName" value="Consumer.A.VirtualTopic.Orders"/>
    <property name="messageListener" ref="processStatusHandler"/>
</bean>

If anyone can help me, I appreciate it.

1

1 Answers

0
votes

I have already encountered the problem. The consumer prefix value is incorrect must be:

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