On Wed, Mar 16, 2011 at 4:40 PM, Rafael Schloming <[email protected]>wrote:

> On 03/16/2011 04:26 PM, Rajith Attapattu wrote:
>
>> While trying to answer a question on the user list, I was trying to test
>> the
>> behaviour around rejecting a message.
>> It seems the 'reject' and 'release' methods are missing from the session
>> class in the new API.
>>
>> Is this a deliberate omission ? is there an alternate way of achieving the
>> same ?
>> (The C++ API does have these methods, all though the JMS API doesn't
>> really
>> have anything of the sort).
>>
>> Regards,
>>
>> Rajith
>>
>>
> There aren't methods, but you can reject and release messages this way:
>
>    session.acknowledge(msg)
>    session.acknowledge(msg, Disposition(REJECTED))
>    session.acknowledge(msg, Disposition(RELEASED))
>    session.acknowledge(msg, Disposition(RELEASED, set_redelivered=True))
>
> The pattern is supposed to allow a bit more flexibility since the set of
> available dispositions is a bit more open ended than just reject and
> release.
>
> Nice !


> --Rafael
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:[email protected]
>
>

Reply via email to