On Mon, Jul 16, 2012 at 10:41 PM, Gordon Sim <[email protected]> wrote:
> On 07/16/2012 01:22 PM, Sitapati das / Joshua J Wulf wrote:
>
>> I'm trying to use the receiver.unsettled() method of the python receiver
>> object (mostly to figure out what it does).
>>
>> When I call it, however, I get this error:
>>
>> Traceback (most recent call last):
>> File "unsettled.py", line 14, in <module>
>> msgs=rx.unsettled()
>> File "<string>", line 6, in unsettled
>> File "/usr/lib/python2.6/site-**packages/qpid/messaging/**endpoints.py",
>> line
>> 974, in unsettled
>> return len([m for m in self.acked if m._receiver is self])
>> AttributeError: 'Receiver' object has no attribute 'acked'
>>
>> Does the receiver needs to be created with some particular option to be
>> able to use this method?
>>
>
> No, that looks like a bug. Does ssn.unsettled() give the same error? Could
> you raise a JIRA and list the version you are using? Thanks!
# python unsettled.py
Traceback (most recent call last):
File "unsettled.py", line 20, in <module>
msgs = ssn.unsettled()
AttributeError: Session instance has no attribute 'unsettled'
Which is what I would have expected, given that the API docs make no
mention of an unsettled() method for a session:
http://qpid.apache.org/apis/0.16/python/html/qpid.messaging.endpoints.Session-class.html<http://qpid.apache.org/apis/0.16/python/html/index.html>
I'll open a JIRA for the receiver.
>
>
> Here's a minimal case that reproduces this error:
>>
>> import sys
>> from qpid.messaging import *
>>
>> connection=Connection("**localhost:5672")
>> connection.open()
>> try:
>> ssn=connection.session()
>> rx=ssn.receiver("test; {create:always}")
>> tx=ssn.sender("test")
>> tx.send("hello")
>>
>> rx.fetch()
>> msgs=rx.unsettled()
>> print msgs
>> ssn.acknowledge()
>>
>> finally:
>> connection.close()
>>
>>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail:
> [email protected].**org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>