activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Mittler" <nathan.mitt...@gmail.com>
Subject Re: setting jms property using stop c
Date Wed, 05 Apr 2006 20:45:40 GMT
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 <vikram.dhawan@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.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message