AMQP&Openwire - Activemq 代理和 2 个不同的消费者 [英] AMQP & Openwire - Activemq broker and 2 different consumers

查看:11
本文介绍了AMQP&Openwire - Activemq 代理和 2 个不同的消费者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个支持 amqp 和 openwire 的 activeMQ 代理.openwire (tcp, 端口 61616) 的生产者是否有可能将生产到具有使用 amqp 协议的消费者的队列中?

I have an activeMQ broker that supports both amqp and openwire. Is it possible that a producer of openwire (tcp, port 61616) will produce to a queue that have a consumer that uses amqp protocol instead?

或者我是否仅限于相同的协议消费者和生产者?

or am i limited to the same protocol consumers&producers only?

推荐答案

是的,可以使用 ActiveMQ 与 OpenWire JMS 客户端和 AMQP 客户端进行互操作.保存消息的目的地不是单独的空间,因此由一种类型的客户端在队列中放置的消息可以由来自其他协议的客户端使用.

Yes, it is possible to interoperate with the OpenWire JMS client and an AMQP client using ActiveMQ. The destinations that hold the messages are not separate spaces therefore message place on a Queue by a client of one type are consumable by a client from some other protocol.

您唯一需要解决的是如何将实际消息传达给每个客户.ActiveMQ 提供了一个可配置的转换器,可以在从 AMQP 客户端发送时保留 AMQP 消息的原始字节,或者将该消息转换为更 JMS 样式的消息对象,OpenWire 客户端将作为预期类型(TextMessage、BytesMessage、地图消息...).

The only thing that you have to contend with is how the actual messages are conveyed to each client. ActiveMQ provides a configurable transfomer that can either preserve the original bytes of the AMQP message when sent from an AMQP client or transform that message into a more JMS style message object that would be received by the OpenWire client as the expected type (TextMessage, BytesMessage, MapMessage...).

请参阅 ActiveMQ 的文档以获取有关配置和了解 AMQP 到 OpenWire 消息的映射的帮助.

Refer to the documentation of ActiveMQ for help in configuration and in understanding the mappings of AMQP to OpenWire messages.

http://activemq.apache.org/amqp.html

如果您想要最简单地处理消息被转换并始终以正确的 JMS 类型到达 OpenWire 客户端的场景,请在配置中选择 JMS Transformer,如下所示:

If you want to easiest to handle scenario where messages are transformed and always arrive at the OpenWire client as proper JMS types choose the JMS Transformer in configuration like so:

<transportConnector name="amqp" uri="amqp://localhost:5672?transport.transformer=jms"/>

这篇关于AMQP&amp;Openwire - Activemq 代理和 2 个不同的消费者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆