You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by qbeardn <bo...@msn.com> on 2008/12/26 23:57:25 UTC

Re: ::cms::Message class and properties

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
wrappers).

cheers,
bob



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 <la...@rediffmail.com> 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:
>> http://www.nabble.com/%3A%3Acms%3A%3AMessage-class-and-properties-tf3173160.html#a8802789
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/%3A%3Acms%3A%3AMessage-class-and-properties-tp8802789p21179711.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ::cms::Message class and properties

Posted by Timothy Bish <ta...@gmail.com>.
You could create a Jira issue to capture any ideas you have on how to
add such support to ActiveMQ-CPP, and as always contributions are always
welcome.

Regards
Tim.

On Fri, 2008-12-26 at 14:57 -0800, qbeardn wrote:
> 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
> wrappers).
> 
> cheers,
> bob
> 
> 
> 

-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/