提问者:小点点

ActiveMQ到Apollo转换,Openwire到Stomp协议配置


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

  • 第一个是c,使用openwire和tcp
  • 第二个是Javascript,并在websocket中使用跺脚

使用ActiveMQ,一切都运行良好,我发送的消息可以在两个软件上读写,从那以后我没有更改客户端。

现在,我从c soft(使用openwire)发送消息,并尝试使用JSsoft读取它们,但我得到错误。事实上,我收到的消息标题内容类型为:“协议/openwire”,但我期望跺脚。

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

<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>

我也试过用

有人能帮我弄清楚吗?

谢谢你,

编辑:

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

以下是从actiemq openwire和apollo openwire收到的相同消息,然后使用相同的c发布者和js订阅者:

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
"

你认为这在Apollo会有问题吗?


共1个答案

匿名用户

ActiveMQ 5.6处理将逻辑OpenWire消息转换为STOMP客户端的文本表示。Apollo,目前还不支持该功能!:(参见:

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

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