首页 > 解决方案 > 使用 subscriptionShared 和 subscriptionDurable 制作 DefaultMessageListenerContainer

问题描述

由于在所有消费者之间共享持久订阅,我想使用subscriptionSharedand subscriptionDurablein 。DefaultMessageListenerContainer

Tomcat 启动后,我多次看到此日志消息,似乎我的主题有问题:

Setup of JMS message listener invoker failed for destination x.y.z trying to recover. cause:org.apache.activemq.ActiveMQSession.createSharedDurableConsumer (Ljavax/jms/Topic;Ljava/lang/String;)Ljavax/jms/MessageConsumer"

我的 Spring 版本是4.3.8. 我使用 ActiveMQ Artemis2.9.0和 JMS 2.0

标签: springspring-jmsactivemq-artemis

解决方案


基于错误消息包含的事实,在org.apache.activemq.ActiveMQSession我看来,您正在使用 ActiveMQ 5.x 中的 OpenWire JMS 客户端。此 JMS 客户端不支持 JMS 2.0,因此不支持共享持久订阅。您需要使用来自 ActiveMQ Artemis 的 JMS 客户端。


推荐阅读