简体   繁体   English

使用artemis-jms-client从ActiveMQ Artemis接收引发InvalidDestinationException

[英]Receiving from ActiveMQ Artemis with artemis-jms-client throws InvalidDestinationException

I have this in my code 我的代码中有这个

consumer = session.createConsumer(session.createQueue("myQueue"));

It throws the following exception 它引发以下异常

javax.jms.InvalidDestinationException: AMQ119019: Queue already exists test_simple_transaction_receiver
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:406)
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:304)
        at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createQueue(ActiveMQSessionContext.java:546)
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:1622)
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:249)
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:628)
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:331)
        at consumeMessage(ReceiverClient.java:143)

I used a wrong version of artemis-jms-client . 我使用了错误的artemis-jms-client My broker is Artemis 2.0.0 and I used artemis-jms-client 1.5.3. 我的经纪人是Artemis 2.0.0,我使用了artemis-jms-client 1.5.3。

With a matching client library version, the receiving works. 使用匹配的客户端库版本,接收即可工作。

I made this mistake once already, so I am posting about it here in case it helps somebody else, or me third time still. 我已经犯过一次这个错误,因此我在这里发布有关此消息的信息,以防它对其他人或我有帮助。

Artemis 2.0.0 has a new addressing model. Artemis 2.0.0具有新的寻址模型。 if you need backward compatibility you have to configure the acceptors in such way the older clients would connect. 如果需要向后兼容,则必须以旧客户端连接的方式配置接收器。

So, I would recommend just updating your client. 因此,我建议您仅更新您的客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM