RabbitMQ 真的可以与 Amazon MQ (ActiveMQ) 一起使用吗?
Does RabbitMQ really work with Amazon MQ (ActiveMQ)?
我有一个 Java RabbitMQ 生产者应用程序,我想从 Amazon MQ(我已经创建了代理)在 ActiveMQ 上发送一些消息。我按照 this page.
的步骤
我为 RabbitMQ 制作了 Java 示例,起初它看起来不错,但是当我创建到我的端点的连接时(用户名和密码也是如此):amqps://x-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-x.xx.xx-xxxx-x.amazonaws.com:5671
在这一行中:
factory.newConnection();
我遇到了这些错误:
内部库错误:
[AMQP Connection xx.xx.xx.xx:5671] ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occured
com.rabbitmq.client.MalformedFrameException: AMQP protocol version mismatch; we are version 0-9-1, server sent signature 3,1,0,0
at com.rabbitmq.client.impl.Frame.protocolVersionMismatch(Frame.java:170)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:107)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:645)
at java.lang.Thread.run(Thread.java:745)
我遇到的错误:
null com.rabbitmq.client.ShutdownSignalException: connection error
我知道主要错误是版本不匹配,但是有没有办法通过更改版本协议来修复它,或者这是不可能的?
因为示例中的 RabbitMQ 使用 AMQP 0-9。
ActiveMQ(均5.x "classic" and Artemis)支持AMQP 1.0。如果 RabbitMQ 客户端使用 AMQP 1.0,那么它应该可以工作。如果没有,那就不会。
您引用的文档并未表明 RabbitMQ 客户端将与 ActiveMQ 一起工作。它只是演示了 RabbitMQ 客户端的常见用法,然后提供了替代的 JMS 示例。在 "Conclusion" 部分,文章指出:
In this post, I reviewed how to get started with an Amazon MQ broker and walked you through several code examples that explored the differences between RabbitMQ and Apache ActiveMQ client integrations. If you are considering migrating to Amazon MQ, these examples should help you understand the changes that might be required.
换句话说,您必须更改您的应用程序。您不能将 RabbitMQ 客户端与 ActiveMQ 一起使用。
我有一个 Java RabbitMQ 生产者应用程序,我想从 Amazon MQ(我已经创建了代理)在 ActiveMQ 上发送一些消息。我按照 this page.
的步骤我为 RabbitMQ 制作了 Java 示例,起初它看起来不错,但是当我创建到我的端点的连接时(用户名和密码也是如此):amqps://x-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-x.xx.xx-xxxx-x.amazonaws.com:5671
在这一行中:
factory.newConnection();
我遇到了这些错误:
内部库错误:
[AMQP Connection xx.xx.xx.xx:5671] ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occured
com.rabbitmq.client.MalformedFrameException: AMQP protocol version mismatch; we are version 0-9-1, server sent signature 3,1,0,0
at com.rabbitmq.client.impl.Frame.protocolVersionMismatch(Frame.java:170)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:107)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:645)
at java.lang.Thread.run(Thread.java:745)
我遇到的错误:
null com.rabbitmq.client.ShutdownSignalException: connection error
我知道主要错误是版本不匹配,但是有没有办法通过更改版本协议来修复它,或者这是不可能的?
因为示例中的 RabbitMQ 使用 AMQP 0-9。
ActiveMQ(均5.x "classic" and Artemis)支持AMQP 1.0。如果 RabbitMQ 客户端使用 AMQP 1.0,那么它应该可以工作。如果没有,那就不会。
您引用的文档并未表明 RabbitMQ 客户端将与 ActiveMQ 一起工作。它只是演示了 RabbitMQ 客户端的常见用法,然后提供了替代的 JMS 示例。在 "Conclusion" 部分,文章指出:
In this post, I reviewed how to get started with an Amazon MQ broker and walked you through several code examples that explored the differences between RabbitMQ and Apache ActiveMQ client integrations. If you are considering migrating to Amazon MQ, these examples should help you understand the changes that might be required.
换句话说,您必须更改您的应用程序。您不能将 RabbitMQ 客户端与 ActiveMQ 一起使用。