Selector and payload

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Selector and payload

jaiganesh.m
This might be a really stupid question but I had to get it cleared.

I create a ActiveMQTextMessage with a simple string.

ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setJMSType("text");
message.setProperty("msgOpCode", "some_Op_code");
message.setText("Some string");

I am able to apply selectors on the property msgOpCode as well as the text.

The JMS specification says that "Only messages whose header and property values match the selector are delivered"
So, what exactly is a payload in a ActiveMQMessage. I want the contents that I set in the text to be the  payload/body of the message. How do I set this ?
Reply | Threaded
Open this post in threaded view
|

Re: Selector and payload

clark
I don't think  most providers read the JMS  as  exclusionary but anyway if you want to use only API provided by the JMS specifications then you can.  The examples included with  ActiveMQ  provide examples on how to send messages using only the  JMS standard API.
-clark

www.ttmsolutions.com
ActiveMQ reference guide at
http://bit.ly/AMQRefGuide

Jai_M wrote
This might be a really stupid question but I had to get it cleared.

I create a ActiveMQTextMessage with a simple string.

ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setJMSType("text");
message.setProperty("msgOpCode", "some_Op_code");
message.setText("Some string");

I am able to apply selectors on the property msgOpCode as well as the text.

The JMS specification says that "Only messages whose header and property values match the selector are delivered"
So, what exactly is a payload in a ActiveMQMessage. I want the contents that I set in the text to be the  payload/body of the message. How do I set this ?