[rabbitmq-discuss] Using Pika Python client library with BlockingConnections and publisher-confirms - Does it work?

Marek Majkowski majek04 at gmail.com
Mon Feb 6 11:59:52 GMT 2012


<shameless plug>
It's rather simple using Puka:

    client = puka.Client("amqp://localhost/")

    promise = client.connect()
    client.wait(promise)

    promise = client.basic_publish(exchange='', routing_key='test',
body="Hello world!")
    client.wait(promise)

https://github.com/majek/puka/blob/master/examples/send.py
</shameless plug>

On Sat, Feb 4, 2012 at 11:56, Ask Solem <ask at rabbitmq.com> wrote:
>
> On 3 Feb 2012, at 23:49, Matt Pietrek wrote:
>
>>
>> Our app is such that the asynchronous processing model doesn't work for us. We want to reliably pull one message at a time off the queue, process it, acknowledge it, and be done with it.
>>
> [...]
>> And this is where I hit the wall. I can't get publisher-confirm callbacks to work. The callback is never called. Is this expected to work?
>
>
> AFAIK for publisher confirms to work you would need to drain events from
> the connection.  Currently you are just writing data to the socket, and never
> reading the replies back, so the callback won't be triggered.
>
> Now, actually draining events while publishing messages is tricky in a blocking
> application, you would have to find some smart way of alternating between reading
> and writing to the socket.  Maybe there are mechanisms in pika for this, but I don't know.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list