activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spamtrap <nospam.1.friedbad...@spamgourmet.com>
Subject Re: ActiveMQ-CPP message priority
Date Thu, 01 Oct 2015 07:08:29 GMT
On Fri, 25 Sep 2015 12:01:15 -0400, Timothy Bish
<tabish121@gmail.com> wrote:

>On 09/25/2015 11:44 AM, spamtrap wrote:
>> On Fri, 25 Sep 2015 11:34:56 -0400, Timothy Bish
>> <tabish121@gmail.com> wrote:
>>
>>> On 09/25/2015 11:29 AM, spamtrap wrote:
>>>> If you set the message priority with cms::Message::setPriority() and
>>>> then send the message with cms::MessageProducer::send() then the
>>>> priority of the message is ignored and the message is sent with the
>>>> default priority of the MessageProducer.  This seems like a bug to me.
>>>>
>>>>
>>>>
>>> Not a bug, the CMS API works the same as the JMS API in this regard, the
>>> Message set methods can be used on received message to play around with
>>> the values but the MessageProducer that sends the Messages is the
>>> authority on the values applied on send.  To set priority on sent
>>> message either set the value using the setter MessageProducer, or use
>>> the send method that takes priority as an argument. 
>> It's certainly counter-intuituive IMHO.  Why have a method for setting
>> the priority on the message object if it's ignored when sending?
>>
>>
>>
>Shouldn't be to hard to figure out it works this way given the API docs
>are clear on this fact:
>
>        /**
>         * Sets the Priority Value for this message
>         *
>         * CMS providers set this field when a message is sent. This
>method can
>         * be used to change the value for a message that has been received.
>         *
>         * @param priority
>         *      priority value for this message
>         *
>         * @throws CMSException - if an internal error occurs.
>         */
>        virtual void setCMSPriority(int priority) = 0;

Following up on this it would be handy if there was a new
MessageProducer method send that just took the message pointer & the
priority:

virtual void 	send (Message *message, int priority)=0



Mime
View raw message