How to use Arithmetic conditions and Operators in ActiveMQ/JMS Selectors using the Stomp protocol

StackOverflow https://stackoverflow.com/questions/571617

  •  05-09-2019
  •  | 
  •  

Question

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

Was it helpful?

Solution

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

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top