You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Rajith Attapattu <ra...@gmail.com> on 2011/03/16 21:26:52 UTC

[python client] Why reject and release not available in new API ?

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

Re: [python client] Why reject and release not available in new API ?

Posted by Carl Trieloff <cc...@redhat.com>.

That seems like an omission to me.

Carl.


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
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [python client] Why reject and release not available in new API ?

Posted by Gordon Sim <gs...@redhat.com>.
On 03/16/2011 09:14 PM, Andrew Stitcher wrote:
> On Wed, 2011-03-16 at 16:40 -0400, Rafael Schloming 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.
>
> As Rajith says this is nice, but perhaps there should be some wrappers
> for these as they are not intuitive for someone either coming from the C
> ++ API or the old API (IMO).

I raised https://issues.apache.org/jira/browse/QPID-3178 in order to 
ensure we revisit this and aim for more consistency for the next release.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [python client] Why reject and release not available in new API ?

Posted by Andrew Stitcher <as...@redhat.com>.
On Wed, 2011-03-16 at 16:40 -0400, Rafael Schloming 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.

As Rajith says this is nice, but perhaps there should be some wrappers
for these as they are not intuitive for someone either coming from the C
++ API or the old API (IMO).

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [python client] Why reject and release not available in new API ?

Posted by Rajith Attapattu <ra...@gmail.com>.
On Wed, Mar 16, 2011 at 4:40 PM, Rafael Schloming <ra...@redhat.com>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:dev-subscribe@qpid.apache.org
>
>

Re: [python client] Why reject and release not available in new API ?

Posted by Rafael Schloming <ra...@redhat.com>.
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.

--Rafael

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org