You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by vik Dhawan <vi...@lexisnexis.com> on 2006/04/04 20:33:18 UTC
setting jms property using stop c
How can we set jms property (string or other types) using the stop c api.
Thanks!
--
View this message in context: http://www.nabble.com/setting-jms-property-using-stop-c-t1394723.html#a3750126
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: setting jms property using stop c
Posted by Nathan Mittler <na...@gmail.com>.
Hi Vik,
Since header properties are the only properties you can set in a STOMP
message, what your question boils down to is what does the ActiveMQ broker
do with those properties - in particular when it forwards those messages to
a Java client. My guess is that it would simply copy them over to the JMS
message so that you could retrieve them via a call to getProperty().
After a brief look at the code, I found this in org.apache.activemq
/transport.stomp.FrameBuilder
public FrameBuilder addHeaders(ActiveMQMessage message) throws IOException {
addHeader(Stomp.Headers.Message.DESTINATION,
DestinationNamer.convert(message.getDestination()));
addHeader(Stomp.Headers.Message.MESSAGE_ID, message.getJMSMessageID());
addHeader(Stomp.Headers.Message.CORRELATION_ID,
message.getJMSCorrelationID());
addHeader(Stomp.Headers.Message.EXPIRATION_TIME,
message.getJMSExpiration());
if (message.getJMSRedelivered()) {
addHeader(Stomp.Headers.Message.REDELIVERED, "true");
}
addHeader(Stomp.Headers.Message.PRORITY, message.getJMSPriority());
addHeader(Stomp.Headers.Message.REPLY_TO,
DestinationNamer.convert(message.getJMSReplyTo()));
addHeader(Stomp.Headers.Message.TIMESTAMP, message.getJMSTimestamp());
addHeader(Stomp.Headers.Message.TYPE, message.getJMSType());
// now lets add all the message headers
Map properties = message.getProperties();
if (properties != null) {
headers.putAll(properties);
}
return this;
}
So this class creates stomp frames from JMS messages (the opposite direction
for the question you're asking). But after a quick inspection, it looks
like all JMS properties are transferred to the stomp header. I would guess
that the reciprocal operation is performed when going from stomp to JMS
messages. If this is true, then the stomp header is the place to stick
everything. But we should probably get some input from someone on the
ActiveMQ team ... James?
As far as CMS is concerned, it is limited to the stomp protocol, so it would
have to use the header properties map to set properties.
Regards,
Nate
On 4/5/06, vik Dhawan <vi...@lexisnexis.com> wrote:
>
>
> Hey Nate,
>
> Thanks for headsup. I looked into it already and you are correct you can
> set
> properties in the header, but according to JMS specs/ Sun Message
> interface
> specs (and offcourse the way we implemented OpenWire and Java API),
> properties should be considered saparate from Header and as the way of
> Customizing message from the application prepective.
>
> I am not sure if setting header properties using the C stomp client can be
> retrived with the getProperty call from Java client.
>
> Please let me know when the CMS release will have that feature avaiable,
> and
> is there a plan to mofidy frame structure for C stomp implementation which
> is using apr?
>
> Thanks!
>
>
> --
> View this message in context:
> http://www.nabble.com/setting-jms-property-using-stop-c-t1394723.html#a3772510
> Sent from the ActiveMQ - Dev forum at Nabble.com.
>
>
RE: setting jms property using stop c
Posted by vik Dhawan <vi...@lexisnexis.com>.
Hey Nate,
Thanks for headsup. I looked into it already and you are correct you can set
properties in the header, but according to JMS specs/ Sun Message interface
specs (and offcourse the way we implemented OpenWire and Java API),
properties should be considered saparate from Header and as the way of
Customizing message from the application prepective.
I am not sure if setting header properties using the C stomp client can be
retrived with the getProperty call from Java client.
Please let me know when the CMS release will have that feature avaiable, and
is there a plan to mofidy frame structure for C stomp implementation which
is using apr?
Thanks!
--
View this message in context: http://www.nabble.com/setting-jms-property-using-stop-c-t1394723.html#a3772510
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: setting jms property using stop c
Posted by vik Dhawan <vi...@lexisnexis.com>.
I looked at C api in Stomp and didn’t find the way to set property. Then I
went ahead and looked in the CMS implementation for stomp also and not
found there either.
thanks!
--
View this message in context: http://www.nabble.com/setting-jms-property-using-stop-c-t1394723.html#a3769983
Sent from the ActiveMQ - Dev forum at Nabble.com.
Re: setting jms property using stop c
Posted by James Strachan <ja...@gmail.com>.
Which C API? there's a C API in Stomp and there's CMS in ActiveMQ?
On 4/4/06, vik Dhawan <vi...@lexisnexis.com> wrote:
>
> BTW it will help if i explain more :). i am talking about setting and getting
> the message properties.
>
> Thanks!
> --
> View this message in context: http://www.nabble.com/setting-jms-property-using-stop-c-t1394723.html#a3750143
> Sent from the ActiveMQ - Dev forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/
Re: setting jms property using stop c
Posted by vik Dhawan <vi...@lexisnexis.com>.
BTW it will help if i explain more :). i am talking about setting and getting
the message properties.
Thanks!
--
View this message in context: http://www.nabble.com/setting-jms-property-using-stop-c-t1394723.html#a3750143
Sent from the ActiveMQ - Dev forum at Nabble.com.