简体   繁体   English

ActiveMQ:消费者/生产者为同一队列实现不同的协议?

[英]ActiveMQ: consumer / producer implement different protocols for the same queue?

I am getting into Message Queueing recently (with ActiveMQ) and experimenting. 我最近(使用ActiveMQ)进入消息队列并进行试验。

So far I have been able to set up one producer with 2 consumers written in Java implementing JMS over Tcp. 到目前为止,我已经能够用2个用Java编写的使用者建立一个生产者,该使用者使用Tcp实现JMS。 The producer sends 2 types of messages to the queue in ActiveMQ, while at the other end, 2 consumers from a different machine pick up the messages based on the message properties. 生产者将2种类型的消息发送到ActiveMQ中的队列,而在另一端,来自另一台计算机的2个使用者根据消息属性来接收消息。

My question was: 我的问题是:

  • Does the consumer/producer need to implement the same protocol, or 消费者/生产者是否需要实施相同的协议,或者
    Would it be possible to have a producer send messages to the Queue with JMS and have a client (like node js) use another protocol (like AMQP) and collect messages from the same queue? 是否可以让生产者使用JMS将消息发送到队列,并让客户端(例如节点js)使用其他协议(例如AMQP)并从同一队列收集消息?

Thank you for your advice, 感谢您的意见,

Probably the answer to your question is documented at Oracle's JMS as a MOM Standard : 可能在Oracle的JMS中将您的问题的答案记录为MOM标准

It's important to note that JMS is an API standard, not a protocol standard. 重要的是要注意,JMS是API标准,而不是协议标准。 Because all JMS clients implement the same interface, it is easy to port one vendor's clinet to another vendor's JMS provide implementation. 由于所有JMS客户端都实现相同的接口,因此很容易将一个供应商的客户端移植到另一供应商的JMS提供的实现中。 But different JMS vendors typically cannot communicate directly with one another . 但是,不同的JMS供应商通常无法直接相互通信

ActiveMQ implements the standard JMS client library using it's own protocol (OpenWire) however it also supports several other protocols allowing you to connect from other client like an MQTT client, STOMP client or an AMQP client and consume / produce from a Queue. ActiveMQ使用自己的协议(OpenWire)实现标准JMS客户端库,但是它还支持其他几种协议,允许您从其他客户端(如MQTT客户端,STOMP客户端或AMQP客户端)进行连接,并从队列使用/产生。

To see how to use AMQP for instance refer to the ActiveMQ docs and for best results use the latest release of ActiveMQ. 要查看如何使用AMQP,请参阅ActiveMQ文档,并使用最新版本的ActiveMQ以获得最佳效果。

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

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