activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qbeardn <>
Subject Re: ::cms::Message class and properties
Date Fri, 26 Dec 2008 22:57:25 GMT

Hi, I am bothered by this same issue.

The JMS 1.1 spec does provide a way to programmatically determine and set
the type of message properties: you can use getObjectProperty /
setObjectProperty.  For reference, section 3.5.5 says "Their purpose is to
allow the decision of property type to made at execution time rather than at
compile time."

CMS is missing this capability which appears to be an oversight.  I
understand that it is possible to encode this information using strings, but
that is a poor substitute.  I accept that it may be desirable for the CMS to
provide this functionality using a different interface (maybe PropertyType
getPropertyType (const string &name), instead of using the decaf Primitive


nmittler wrote:
> Unfortunately the CMS and JMS APIs do not provide this capability
> directly.
> What you could do is make it a string property and encode something at the
> beginning (e.g. "int:123"), this way the application on the other end
> knows
> how to decode it.
> On 2/5/07, Lalit Nagpal <> wrote:
>> Hi
>> Just observed the ::cms::Message header file in CMS API - latest trunk
>> code
>> .... The class gives different overloaded methods to store properties as
>> int
>> / float / string / double etc .... it also gives all the getter methods
>> for
>> retrieving properties for int / float and so on .....
>> In my code I try to loop into a set of name-value pairs that are passed
>> to
>> me and now need to be set in as message properties .... depending on data
>> types I use the appropriate setter methods to set these ... like setInt
>> for
>> integer property etc ....
>> Now at the receiving end (after the message has floated to the consumer)
>> ideally situation should have been that I should know the datatype of the
>> property that has been set somehow ..... this is not the case .... their
>> is
>> no way for me to know which property is of what data type ... this puts
>> me
>> in a fix and I need to apply a dirty patch here ....
>> Can such a thing be added ..... The getter/setter methods do not solve
>> the
>> purpose in looping otherwise ...
>> Regards
>> Lalit Nagpal
>> CSA, SunGard
>> --
>> View this message in context:
>> Sent from the ActiveMQ - User mailing list archive at

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message