python - Asynchronous AMQP producer and consumer -


i have bidirectional amqp service both consumes messages queue , publishes fanout exchange. clients, symmetrically, consume exchange , publish queue. (this isn't chat server, can thought of chat server.) incoming , outgoing messages not 1:1. outgoing messages may in response incoming message, or may generated based on time or other asynchronous factors such changes database.

i have built in python using pika blockingconnection, requires 2 full connections (each 1 channel) , threading. channels not bidirectional in amqp, , have not found way manage 2 channels simultaneously blockingconnection. time-based messages awkward , limited, because based on connection.sleep(). i've tried convert selectconnection, having trouble managing callbacks 2 channels.

i convert non-threaded asynchronous system single connection having 2 channels. working in python 3.5, based on coroutines or asyncio seems ideal. i'm happy leave pika (i'm exploring kombu, since we're using celery, still having trouble handling both producer , consumer; i've looked @ amqpstorm, though i'd prefer async rather threaded). requirement python 3.5. performance not pressing concern (i expect less 100 msg/sec); implementation simplicity , flexibility more important.

is practical in pika (or other python amqp system) manage 2 channels, 1 in each direction?


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -