13
Async AMQP kombu + gevent https://github.com/renskiy/async_amqp

Asynchronous AMQP

Embed Size (px)

Citation preview

Page 1: Asynchronous AMQP

Async AMQPkombu + gevent

https://github.com/renskiy/async_amqp

Page 2: Asynchronous AMQP

Table of contents

• requirements

• AMQP

• gevent + kombu

• solution

• useful links and questions

Page 3: Asynchronous AMQP

Queues are useful for

• process synchronization

• deferred computations

• slow I/O

Page 4: Asynchronous AMQP

Somewhere in the code

Page 5: Asynchronous AMQP

Requirements

• Python 2.x (2.5 or higher)

• gevent

• kombu

Page 6: Asynchronous AMQP

Advanced Message Queuing Protocol

• Broker

• Message

• All messages are published into Exchange

• Client consumes messages from Queue

• Messages from Exchange are routed to Queue based on condition specified by Binding

Page 7: Asynchronous AMQP

Exchange types• direct - exact match of message’s Routing Key and

binding’s one

• topic - basic routing based on wildcard matching of Routing Key treated as zero or more words separated by «.» («*» - single word, «#» - zero or more words)

• fanout - simple broadcast

• headers - more complicated routing based on custom headers matching

Page 8: Asynchronous AMQP

gevent + kombu

Page 9: Asynchronous AMQP

Publisher

Page 10: Asynchronous AMQP

Sync Consumer

Page 11: Asynchronous AMQP

Async Consumer

Page 12: Asynchronous AMQP

Semaphore Consumer

Page 13: Asynchronous AMQP

Useful links

• https://github.com/renskiy/async_amqp

• http://mutlix.blogspot.ru/2007/09/amqp-in-10-mins-part0.html

• http://sdiehl.github.io/gevent-tutorial/