You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Sitapati das / Joshua J Wulf <si...@worldsankirtan.net> on 2012/07/16 14:22:44 UTC

Receiver.unsettled()

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?

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()

Re: Receiver.unsettled()

Posted by Gordon Sim <gs...@redhat.com>.
On 07/16/2012 10:45 PM, Sitapati das / Joshua J Wulf wrote:
> # 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:

Yes, sorry, that was a stupid question on my part.

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

Great, I see it and will take a look shortly.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Receiver.unsettled()

Posted by Sitapati das / Joshua J Wulf <si...@worldsankirtan.net>.
On Mon, Jul 16, 2012 at 10:41 PM, Gordon Sim <gs...@redhat.com> 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: users-unsubscribe@qpid.apache.**org<us...@qpid.apache.org>
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Receiver.unsettled()

Posted by Gordon Sim <gs...@redhat.com>.
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!

> 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: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org