在Apache ActiveMQ Artemis中,我如何强制Stomp消息为文本而不是二进制?

huangapple go评论47阅读模式
英文:

In Apache ActiveMQ Artemis, how can I force Stomp messages to be text instead of binary?

问题

我们刚切换到了Apache ActiveMQ Artemis,启用了Stomp服务器用于JavaScript WebSocket订阅,一切都正常运行,但我们收到的消息是“某种程度上”的二进制数据。

帧被标记为isBinaryBody: true,我还能看到一个伴随的binaryBody属性。

我了解这是Apache ActiveMQ Artemis的默认行为,但是否有办法禁用/配置它,使其只处理文本消息?

英文:

We have just switched to Apache ActiveMQ Artemis, enabling the Stomp server for Javascript WebSocket subscriptions, and everything is working fine, but we're receiving messages as "kind of" binary data.

Frames are marked as isBinaryBody: true and I can also spot a companion binaryBody property.

I understand that this is the default behaviour in Apache ActiveMQ Artemis, but is there any way to disable/configure this and make it work with text only messages?

答案1

得分: 0

ActiveMQ Artemis目前是硬编码为二进制来编码WebSocket帧的。没有办法配置代理以不同的方式进行编码。不过,我已经打开了ARTEMIS-4294并发送/合并了用于此功能的PR。它将在2.29.0中可用,您可以在stomp acceptor上设置webSocketEncoderType=text

英文:

Currently ActiveMQ Artemis is hard-coded to encode WebSocket frames as binary. There is no way to configure the broker to do it differently. However, I have opened ARTEMIS-4294 and sent/merged a PR for this functionality. It will be available in 2.29.0, and you can set webSocketEncoderType=text on the stomp acceptor.

huangapple
  • 本文由 发表于 2023年5月26日 14:41:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76338233.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定