[ 
https://issues.apache.org/jira/browse/PROTON-1242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15956785#comment-15956785
 ] 

Justin Ross commented on PROTON-1242:
-------------------------------------

The Proton BlockingConnection class explicitly does not work with sleeps.  
There is no separate worker thread to process IO.  Anything that freezes the 
main thread (the only thread) will prevent that processing.

That's the case in general.  I'm not sure why specifically options=AtMostOnce() 
has trouble here.

> Sending at-most-once (presettled) messages with a delay between them does not 
> work with BlockingConnection
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: PROTON-1242
>                 URL: https://issues.apache.org/jira/browse/PROTON-1242
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>    Affects Versions: 0.13.0
>         Environment: Red Hat Enterprise Linux 6.8 64bit, dispatch-router 0.6.0
>            Reporter: Jiri Danek
>         Attachments: slow_presettled_send_blocking.py
>
>
> Messenger blocking API should work in combination with calls to 
> {{time.sleep()}}. For example, if I wish to send certain number of messages 
> with 0.5s delay between each, I should be able to write
> {code}
> messages = 5
> host, path = address.split('/')
>     conn = BlockingConnection(host)
>     sender = conn.create_sender(path, options=AtMostOnce())
> for i in range(messages):
>         sender.send(Message(body="message %d" % i));
>         time.sleep(0.5)
> {code}
> The code above does not work. I tried sending over Qpid Dispatch Router and 
> receiving with the simple_recv.py example and all five messages arrived at 
> once, after approx. 2 seconds of waiting.
> If I leave out {{options=AtMostOnce()}}, then the code above works as 
> expected and messages arrive one by one with the 0.5s delay.
> Steps to reproduce:
> {{python qpid-proton/examples/python/simple_recv.py -a 
> 172.28.128.251/myaddress}}
> {{python slow_presettled_send_blocking.py -a 172.28.128.251/myaddress -m 5}}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to