如何使用 Stomp 协议在 ActiveMQ/JMS 选择器中使用算术条件和运算符

发布于 2024-07-13 21:52:06 字数 577 浏览 6 评论 0原文

我有几条已设置属性的消息。 其中一些包含数字数据,尽管我在发送消息时没有尝试向 ActiveMQ 显式声明这一点。

当我尝试使用算术条件,即:<、>、<=、>= 和系列时,出现错误。 有没有办法通过 Stomp 使用选择器来使用算术条件? 我已经在网上搜索过,只在谷歌上得到了以下点击: http://rubyforge.org/tracker/index.php?func=detail&aid=21378&group_id=1010&atid=3981

这个问题似乎已经摆在桌面上了修复了 STOMP 协议 v1.1:http://stomp.codehaus.org/ Stomp+v1.1+想法

I have several message with properties set. Some of these contain numeric data, although I have made no attempt to declare this explicitly to ActiveMQ while sending the messages.

When I try to use arithmetic conditions, ie: <, >, <=, >= and family, I get an error.
Is there any way to use arithmetic conditions using selectors via Stomp? I have already searched the web and only got the following hit on google: http://rubyforge.org/tracker/index.php?func=detail&aid=21378&group_id=1010&atid=3981

This issue seems to be on the table to be fixed with v1.1 of the STOMP protocol: http://stomp.codehaus.org/Stomp+v1.1+Ideas

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

千紇 2024-07-20 21:52:07

我发现使用 STOMP 和 ActiveMQ 以数字方式对消息进行选择的唯一方法是使用 XML 消息和 XPATH 选择器:

要使用 XML 消息,ActiveMQ 需要来自 xalan 的三个 jar:

  • xalan.jar
  • xmlImpl.jar
  • xml- apis.jar

所有三个都必须位于 CLASSPATH 中(即:位于 activemq/lib 目录中)。 所有这三个都可以从 xalan 二进制包中获得。

The only way I've found to do selection on messages in a numeric fashion with STOMP and ActiveMQ is to use XML messages and XPATH selectors:

To use XML messages, ActiveMQ requires three jars from xalan:

  • xalan.jar
  • xmlImpl.jar
  • xml-apis.jar

All three must be in the CLASSPATH (ie: in the activemq/lib directory). All three are available from the xalan binary package.

筱果果 2024-07-20 21:52:06

目前,Stomp 将所有属性视为字符串,因此使用算术不起作用。 正如您所发现的,计划在 Stomp 1.1 中支持属性类型,然后您就可以像在 JMS 中一样使用它们。

干杯
德扬

currently Stomp treats all properties as Strings, so using arithmetic does not work. As you found out, it is planned to support property types in Stomp 1.1 and then you'll be able to use them like in JMS.

Cheers
Dejan

恋竹姑娘 2024-07-20 21:52:06

我建议您尝试名为 Apollo 的 ActiveMQ 子项目。 它专注于提供强大的 STOMP 支持,并且支持数字选择器请参阅文档< /a>

I recommend you try out the ActiveMQ subproject called Apollo. It's a focused on having great STOMP support and does support numeric selectors see the docs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文