从ActiveMQ到Apollo的转换,从Openwire到Stomp的协议配置 [英] ActiveMQ to Apollo transition, Openwire to Stomp protocol configuration

查看:495
本文介绍了从ActiveMQ到Apollo的转换,从Openwire到Stomp的协议配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从ActiveMQ 5.6切换到Apollo 1.5。
我有两个用于交换消息的软件,使用主题上的发布/订阅。

I'm trying to switch from ActiveMQ 5.6 to Apollo 1.5. I have two soft that are exchanging messages, using publish/subscribe on topics.


  • 第一个是c ++,使用openwire使用tcp

  • 第二个是Javascript,并在websockets中使用stomp

使用ActiveMQ一切正常很好,并且我发送的消息可以在两个软件上进行读取和写入,并且此后我没有更改客户端。

With ActiveMQ everything worked fine, and the messages I sent could be read and write on both softs, and I didn't changed the clients since.

现在,我从c ++软件发送消息(使用openwire),并尝试使用JS软件阅读它们,但出现错误。实际上,我收到的消息的标头内容类型为: protocol / openwire,但我希望如此。

Now, I send messages from the c++ soft (using openwire), and try to read them with the JS soft, and I get errors. In fact I receive message with header content-type: "protocol/openwire", but I expect stomp.

这是配置apollo.xml连接器部分的方式:

this is how I configured apollo.xml connector section :

<connector id="tcp" bind="tcp://0.0.0.0:61613">
    <openwire max_inactivity_duration="-1" max_inactivity_duration_delay="-1" />
    <stomp max_header_length="10000" die_delay="-1" />
</connector>
<connector id="ws" bind="tcp://0.0.0.0:61623">
    <stomp max_header_length="10000" die_delay="-1" />
</connector>

我也在tcp和ws连接器中尝试了< detect />,应该可以自动检测客户协议,但也不起作用。

I also tried with <detect /> in tcp and ws connector, that is supposed to auto detect client protocol, but dosen't work either.

有人可以帮我弄清楚这个问题吗?

Does someone can help me to figure this out ?

谢谢

编辑:

我发现我确实收到了stomp协议消息,但是它们的格式很奇怪,甚至包含非文本字符,这些字符使stomp.js无法解析消息并正确填充消息正文。

I found out that I do receive stomp protocol messages, but they are very weirdly formated, and even contains non text char that make stomp.js fail to parse the message and correctly fill the message body.

这是一次从activemq openwire接收到的相同消息,然后从同一c ++发布者和js订户使用apollo openwire接收:

here are the same message received once from activemq openwire and then apollo openwire in with the same c++ publisher and js subscriber :

activemq


    "MESSAGE
    message-id:ID:myID-61443-1352999572576-0:0:0:0:0
    class:Message.PointToPoint
    destination:/topic/my-topic
    timestamp:1352999626186
    expires:0
    subscription:sub-0
    priority:4

    <PointToPoint xmlns="Message" ><SourceId>u_23</SourceId><TargetId>u_75</TargetId></PointToPoint>"

阿波罗


    "MESSAGE
    subscription:sub-0
    destination:
    content-length:331
    content-type:protocol/openwire
    message-id:xps-broker-291

    Eç{#ID:myID-61463-1352999939140-0:0emy-topicn{#ID:myID-61463-1352999939140-0:0; Å??<PointToPoint xmlns="Message" ><SourceId>u_23</SourceId><TargetId>u_75</TargetId></PointToPoint>(class Message.PointToPoint
"

您认为这可能是阿波罗的问题吗?

Do you think it could be a problem in Apollo ?

推荐答案

ActiveMQ 5.6可以将逻辑OpenWire消息转换为STOMP客户端的文本表示形式。阿波罗目前尚不支持该功能!:(参见:

ActiveMQ 5.6 handles translating the logical OpenWire messages into a text representation for STOMP clients. Apollo, currently does not support that feature yet! :( See:

https://issues.apache.org/jira/browse/APLO-267

它只使用完整的openwire消息并将其用作STOMP消息的主体。只要内容长度标头使用STOMP消息中的二进制数据,BTW就是完全有效的设置正确。

It just takes the full openwire message and uses it as the body of the STOMP message. BTW using binary data in a STOMP message is totally valid as long as the content-length header is properly set.

这篇关于从ActiveMQ到Apollo的转换,从Openwire到Stomp的协议配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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