【发布时间】:2020-09-06 19:54:24
【问题描述】:
我正在向名为 VirtualTopic.Orders 的虚拟主题发布消息(通过 spring-jms)。我将消息发布到 ActiveMQ 没有任何问题,并且可以在 VirtualTopic.Orders 队列中看到该消息,但我无法使用它。这是我的 JmsTemplate bean 声明:
<bean id="jmsTemplateBusinessEvents" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="pubSubDomain" value="true"/>
</bean>
由于this explanation,我已将 pubSubDomain 设置为 true。
我还按照here的说明更改了配置文件activemq.xml:
<destinationInterceptors>
<virtualDestinationInterceptor>
<virtualDestinations>
<virtualTopic name="VirtualTopic.>" prefix="Consumer.*.VirtualTopic.>" selectorAware="false"/>
</virtualDestinations>
</virtualDestinationInterceptor>
</destinationInterceptors>
这是我的消费者指向 Consumer.A.VirtualTopic.Orders 队列:
<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>
如果有人可以帮助我,我将不胜感激。
【问题讨论】: