activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Problems with the AMQP python messenger API
Date Thu, 12 Dec 2013 14:26:09 GMT
On 12/12/2013 01:33 PM, xbhanu wrote:
> Yes, and infact i am doing exactly this. But the accept call has no effect
> it seems.

You also need to set the incoming message window, e.g.

>      messenger = Messenger()
>      messenger.start()

        messenger.incoming_window = 10

>     messenger.subscribe(address)
>
>      message = Message()
>
>      while should_run:
>          messenger.recv()
>          while messenger.incoming:
>              try:
>                  messenger.get(message)
>                  messenger.accept()
>              except Exception, e:
>                  print "Exception occurred while retrieving the message: " +
> e
>              else:
>                  print "Destination: " + message.address + "\n" + \
>                      "Properties: " + str(message.properties) + "\n" + \
>                      "Body: " + str(message.body) + "\n"
>
>     messenger.stop()




Mime
View raw message