views:

285

answers:

2

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&amp;aid=21378&amp;group_id=1010&amp;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

A: 

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.

Phillip Whelan
+2  A: 

Hi Phillip,

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

Dejan Bosanac