SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Plone, RabbitMQ
and messaging
that just works
Asko Soukka & Jukka Ojaniemi
Speakers' background
University of Jyväskylä
the largest Plone user in Finland
● 83 Plone sites
● 2.5 TB data served through Plone
● 700 content editors
Demo (serializing writes)


                               RabbitMQ
 Browser A   M1




                                                               M1
 Browser B             Queue              Queue        Plone
                  M1                              M1
Why message queues?
Why message queues?
We needed a reliable, effective and
scalable solution for:
  ● running asynchronous tasks
  ● being a common integration point
    between services (decoupling).
Why message queues?

”None of the existing ZODB-based mechanism
really scales. When you are really in need for a
real and working queuing mechanism one
would use some external queuing solution (e.g.
something AMQP compatible like RabbitMQ).”

                                – Andreas Jung
Advanced Message Queue
Protocol (AMQP)


Think of it as an highly advanced
post office which can deliver
message to multiple recipients
based on address.
AMQP jargon 1/2

● Message consists of label and payload.

● Producer is a program which sends
  messages to exchange.

● Consumer is a program which mostly waits
  to receive messages.
AMQP jargon 2/2

● Exchange receives the messages from
  producers and pushes them to queues.

● Bindings are how the messages get routed
  from the exchange to a queue.

● Queue is a buffer that stores messages.
Basic messaging
Work queues
                                                        M1
                          Message broker                     Consumer

            M2                M2                   M2
             M1   Exchange    M1                   M1
 Producer                                  Queue
                   (direct)
                                                        M2

                                                             Consumer
Basic messaging
Publish/Subscribe queues
                                                                  M1
                         Message broker
                                                  M1   Consumer
                                          Queue
            M1   Exchange    M1
 Producer
                  (fanout)                                        M1
                                          Queue
                                                  M1
                                                       Consumer
Basic messaging
RPC implementation

                               Message broker

                        Exchange   M1                M1
                                             RPC queue             M1

Client/producer M1
                R1                                        Server
                     R1 Reply_to        R1   Exchange              R1
                         queue
RabbitMQ
● Implements AMQP (Advanced Message
  Queue Protocol) open standard

● Written in Erlang
   ○ made for messaging
   ○ easy to cluster
   ○ fast (enough)

● Industry tested and reliable
Sounds complicated?
Example with
collective.zamqp
Publish and subscribe announcements
                                                              M1
                       Message broker
                                                M1   Site B
                                        Queue
          M1   Exchange    M1
 Site A
                (fanout)                                      M1
                                        Queue
                                                M1
                                                     Site C
Produce messages with
collective.zamqp
from zope.component import getUtility
from collective.zamqp.interfaces import IProducer



producer = getUtility(
    IProducer, name="announcer")
producer.register() # for transaction
producer.publish("Hello World!")
Handle messages with
collective.zamqp
from five import grok
from collective.zamqp.interfaces import IMessageArrivedEvent



@grok.subscribe(IAnnouncement,
                IMessageArrivedEvent)
def handleMessage(message, event):
    logger.info(message.body)
    message.ack()
Overview of
collective.zamqp

                                                    Message handlers
                                                  (as event subscribers)
Producers               Consumers


                                                  IMessageArrivedEvent
                                      stamp
                                     messages
     produce messages
                                                   Consuming Servers


                        AMQP Broker Connections


                                                                            consume
                              Message broker                               messages
Connections in
collective.zamqp
buildout.cfg:

[instance]
zope-conf-additional =
    %import collective.zamqp
    <amqp-broker-connection>
        connection_id example
        ...
    </amqp-broker-connection>
Producers in
collective.zamqp
class Announcer(Producer):
   grok.name("announcements")

  connection_id = "example"

  exchange = "announcements"
  exchange_type = "fanout"
  serializer = "text/plain"
  durable = False
Consuming servers in
collective.zamqp
buildout.cfg:

zope-conf-additional =
    %import collective.zamqp
    ....
    <amqp-consuming-server>
         connection_id example
         site_id Plone
    </amqp-consuming-server>
Consumers in
collective.zamqp
class Announcements(Consumer):
   grok.name("announcements")

  connection_id = "example"
  exchange = "announcements"
  exchange_type = "fanout"
  queue = "" # anonymous temp. queue
  durable = False
  marker = IAnnouncement
Message handlers in
collective.zamqp

@grok.subscribe(IAnnouncement,
                IMessageArrivedEvent)
def handleMessage(message, event):
    logger.info(message.body)
    message.ack()
Overview of
collective.zamqp

                                                    Message handlers
                                                  (as event subscribers)
Producers               Consumers


                                                  IMessageArrivedEvent
                                      stamp
                                     messages
     produce messages
                                                   Consuming Servers


                        AMQP Broker Connections


                                                                            consume
                              Message broker                               messages
It's so simple!




 It really is!
Real world example
Moniviestin video publishing service
● Plone 4.1 site
● Distributed encoder servers (48 CPUs
  combined)
● First version used XML-RPC based
  communication - lots of error handling code.
● New version uses AMQP-messaging.
● Very fast and scalable. Recovers from
  network outages.
Encoder
                Mediainfo
memcached




                  FS



                                    RabbitMQ

     CherryPy
      upload
      service




                            Plone
Thank you
c.zamqp and examples are available at:
● https://github.com/datakurre/collective.zamqp
● https://github.com/datakurre/collective.zamqpdemos
● https://github.com/datakurre/chatbehavior
● https://github.com/datakurre/pubsubannouncements
other relevant links:
● https://www.rabbitmq.com/getstarted.html
● https://www.amqp.org/about/examples
● http://www.manning.com/videla/ (”RabbitMQ in Action”)

Contenu connexe

En vedette

Upgrade to Plone 5
Upgrade to Plone 5Upgrade to Plone 5
Upgrade to Plone 5Philip Bauer
 
Why our mail system is exposed to spoof and phishing mail attacks part 5#9 |...
Why our mail system is exposed to spoof and phishing mail attacks  part 5#9 |...Why our mail system is exposed to spoof and phishing mail attacks  part 5#9 |...
Why our mail system is exposed to spoof and phishing mail attacks part 5#9 |...Eyal Doron
 
PATHS at the eChallenges conference
PATHS at the eChallenges conferencePATHS at the eChallenges conference
PATHS at the eChallenges conferencepathsproject
 
SemEval-2012 Task 6: A Pilot on Semantic Textual Similarity
SemEval-2012 Task 6: A Pilot on Semantic Textual SimilaritySemEval-2012 Task 6: A Pilot on Semantic Textual Similarity
SemEval-2012 Task 6: A Pilot on Semantic Textual Similaritypathsproject
 
PATHS Final state of art monitoring report v0_4
PATHS  Final state of art monitoring report v0_4PATHS  Final state of art monitoring report v0_4
PATHS Final state of art monitoring report v0_4pathsproject
 
Величко М.В. (2014.02.26) — О Майдане и перспективах Украины и России
Величко М.В. (2014.02.26) — О Майдане и перспективах Украины и РоссииВеличко М.В. (2014.02.26) — О Майдане и перспективах Украины и России
Величко М.В. (2014.02.26) — О Майдане и перспективах Украины и Россииmediamera
 
IND-2012-299 Alok Bharati Public School -Golden Hour
IND-2012-299 Alok Bharati Public School -Golden HourIND-2012-299 Alok Bharati Public School -Golden Hour
IND-2012-299 Alok Bharati Public School -Golden Hourdesignforchangechallenge
 
PATHS at the eCult dialogue day 2013
PATHS at the eCult dialogue day 2013PATHS at the eCult dialogue day 2013
PATHS at the eCult dialogue day 2013pathsproject
 
PATHS Final prototype interface design v1.0
PATHS Final prototype interface design v1.0PATHS Final prototype interface design v1.0
PATHS Final prototype interface design v1.0pathsproject
 
My E-mail appears as spam | The 7 major reasons | Part 5#17
My E-mail appears as spam | The 7 major reasons | Part 5#17My E-mail appears as spam | The 7 major reasons | Part 5#17
My E-mail appears as spam | The 7 major reasons | Part 5#17Eyal Doron
 
The old exchange environment versus modern exchange environment part 02#36
The old exchange environment versus modern exchange environment  part 02#36The old exchange environment versus modern exchange environment  part 02#36
The old exchange environment versus modern exchange environment part 02#36Eyal Doron
 
тренинговый центр «настрой»
тренинговый центр «настрой»тренинговый центр «настрой»
тренинговый центр «настрой»Datnov Fedor
 
Fund EcoMarket 2016
Fund EcoMarket 2016Fund EcoMarket 2016
Fund EcoMarket 2016juliadreblow
 
Word pressで情報を得るのに役立つwebサイトの紹介
Word pressで情報を得るのに役立つwebサイトの紹介Word pressで情報を得るのに役立つwebサイトの紹介
Word pressで情報を得るのに役立つwebサイトの紹介Akinori Tateyama
 

En vedette (16)

Upgrade to Plone 5
Upgrade to Plone 5Upgrade to Plone 5
Upgrade to Plone 5
 
Why our mail system is exposed to spoof and phishing mail attacks part 5#9 |...
Why our mail system is exposed to spoof and phishing mail attacks  part 5#9 |...Why our mail system is exposed to spoof and phishing mail attacks  part 5#9 |...
Why our mail system is exposed to spoof and phishing mail attacks part 5#9 |...
 
PATHS at the eChallenges conference
PATHS at the eChallenges conferencePATHS at the eChallenges conference
PATHS at the eChallenges conference
 
SemEval-2012 Task 6: A Pilot on Semantic Textual Similarity
SemEval-2012 Task 6: A Pilot on Semantic Textual SimilaritySemEval-2012 Task 6: A Pilot on Semantic Textual Similarity
SemEval-2012 Task 6: A Pilot on Semantic Textual Similarity
 
Fichas s
Fichas sFichas s
Fichas s
 
PATHS Final state of art monitoring report v0_4
PATHS  Final state of art monitoring report v0_4PATHS  Final state of art monitoring report v0_4
PATHS Final state of art monitoring report v0_4
 
Величко М.В. (2014.02.26) — О Майдане и перспективах Украины и России
Величко М.В. (2014.02.26) — О Майдане и перспективах Украины и РоссииВеличко М.В. (2014.02.26) — О Майдане и перспективах Украины и России
Величко М.В. (2014.02.26) — О Майдане и перспективах Украины и России
 
IND-2012-299 Alok Bharati Public School -Golden Hour
IND-2012-299 Alok Bharati Public School -Golden HourIND-2012-299 Alok Bharati Public School -Golden Hour
IND-2012-299 Alok Bharati Public School -Golden Hour
 
PATHS at the eCult dialogue day 2013
PATHS at the eCult dialogue day 2013PATHS at the eCult dialogue day 2013
PATHS at the eCult dialogue day 2013
 
PATHS Final prototype interface design v1.0
PATHS Final prototype interface design v1.0PATHS Final prototype interface design v1.0
PATHS Final prototype interface design v1.0
 
My E-mail appears as spam | The 7 major reasons | Part 5#17
My E-mail appears as spam | The 7 major reasons | Part 5#17My E-mail appears as spam | The 7 major reasons | Part 5#17
My E-mail appears as spam | The 7 major reasons | Part 5#17
 
The old exchange environment versus modern exchange environment part 02#36
The old exchange environment versus modern exchange environment  part 02#36The old exchange environment versus modern exchange environment  part 02#36
The old exchange environment versus modern exchange environment part 02#36
 
тренинговый центр «настрой»
тренинговый центр «настрой»тренинговый центр «настрой»
тренинговый центр «настрой»
 
Canciones del colegio
Canciones del colegioCanciones del colegio
Canciones del colegio
 
Fund EcoMarket 2016
Fund EcoMarket 2016Fund EcoMarket 2016
Fund EcoMarket 2016
 
Word pressで情報を得るのに役立つwebサイトの紹介
Word pressで情報を得るのに役立つwebサイトの紹介Word pressで情報を得るのに役立つwebサイトの紹介
Word pressで情報を得るのに役立つwebサイトの紹介
 

Similaire à Plone, rabbit mq and messaging that just works

Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStackSean Chang
 
Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012Mike Willbanks
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim CrontabsPaolo Negri
 
Erlang factory slides
Erlang factory slidesErlang factory slides
Erlang factory slidesNoah Linden
 
JUSG - Event Driven Architectures by Alexander Schatten
JUSG - Event Driven Architectures by Alexander SchattenJUSG - Event Driven Architectures by Alexander Schatten
JUSG - Event Driven Architectures by Alexander SchattenChristoph Pickl
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQKnoldus Inc.
 
XMPP & AMQP in Ruby
XMPP & AMQP in RubyXMPP & AMQP in Ruby
XMPP & AMQP in RubyMatt Todd
 
RabbitMQ interview Questions and Answers
RabbitMQ interview Questions and AnswersRabbitMQ interview Questions and Answers
RabbitMQ interview Questions and Answersjeetendra mandal
 
Lindsay distributed geventzmq
Lindsay distributed geventzmqLindsay distributed geventzmq
Lindsay distributed geventzmqRobin Xiao
 
Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1 von gosling
 
2 Vampir Trace Visualization
2 Vampir Trace Visualization2 Vampir Trace Visualization
2 Vampir Trace VisualizationPTIHPA
 
Messaging for Modern Applications
Messaging for Modern ApplicationsMessaging for Modern Applications
Messaging for Modern ApplicationsTom McCuch
 
Data Pipelines with Apache Kafka
Data Pipelines with Apache KafkaData Pipelines with Apache Kafka
Data Pipelines with Apache KafkaBen Stopford
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQPvoluntas
 
Integration and Batch Processing on Cloud Foundry
Integration and Batch Processing on Cloud FoundryIntegration and Batch Processing on Cloud Foundry
Integration and Batch Processing on Cloud FoundryJoshua Long
 

Similaire à Plone, rabbit mq and messaging that just works (20)

Commication Framework in OpenStack
Commication Framework in OpenStackCommication Framework in OpenStack
Commication Framework in OpenStack
 
Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012Message Queues : A Primer - International PHP Conference Fall 2012
Message Queues : A Primer - International PHP Conference Fall 2012
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
 
What is RabbitMQ ?
What is RabbitMQ ?What is RabbitMQ ?
What is RabbitMQ ?
 
The bigrabbit
The bigrabbitThe bigrabbit
The bigrabbit
 
Erlang factory slides
Erlang factory slidesErlang factory slides
Erlang factory slides
 
Erlang factory slides
Erlang factory slidesErlang factory slides
Erlang factory slides
 
JUSG - Event Driven Architectures by Alexander Schatten
JUSG - Event Driven Architectures by Alexander SchattenJUSG - Event Driven Architectures by Alexander Schatten
JUSG - Event Driven Architectures by Alexander Schatten
 
Amqp Basic
Amqp BasicAmqp Basic
Amqp Basic
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 
XMPP & AMQP in Ruby
XMPP & AMQP in RubyXMPP & AMQP in Ruby
XMPP & AMQP in Ruby
 
RabbitMQ interview Questions and Answers
RabbitMQ interview Questions and AnswersRabbitMQ interview Questions and Answers
RabbitMQ interview Questions and Answers
 
Lindsay distributed geventzmq
Lindsay distributed geventzmqLindsay distributed geventzmq
Lindsay distributed geventzmq
 
zeromq
zeromqzeromq
zeromq
 
Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1
 
2 Vampir Trace Visualization
2 Vampir Trace Visualization2 Vampir Trace Visualization
2 Vampir Trace Visualization
 
Messaging for Modern Applications
Messaging for Modern ApplicationsMessaging for Modern Applications
Messaging for Modern Applications
 
Data Pipelines with Apache Kafka
Data Pipelines with Apache KafkaData Pipelines with Apache Kafka
Data Pipelines with Apache Kafka
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQP
 
Integration and Batch Processing on Cloud Foundry
Integration and Batch Processing on Cloud FoundryIntegration and Batch Processing on Cloud Foundry
Integration and Batch Processing on Cloud Foundry
 

Plus de Asko Soukka

Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Embedding BPMN-driven business processes into Plone
Embedding BPMN-driven business processes into PloneEmbedding BPMN-driven business processes into Plone
Embedding BPMN-driven business processes into PloneAsko Soukka
 
Plone and Volto in a Jamstack project
Plone and Volto in a Jamstack projectPlone and Volto in a Jamstack project
Plone and Volto in a Jamstack projectAsko Soukka
 
Deploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayDeploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayAsko Soukka
 
How Plone Excels in GatsbyJS Content Mesh
How Plone Excels in GatsbyJS Content MeshHow Plone Excels in GatsbyJS Content Mesh
How Plone Excels in GatsbyJS Content MeshAsko Soukka
 
ZServer Reloaded with HTTP/2 and WebSocket Support
ZServer Reloaded with HTTP/2 and WebSocket SupportZServer Reloaded with HTTP/2 and WebSocket Support
ZServer Reloaded with HTTP/2 and WebSocket SupportAsko Soukka
 
Building instant features with advanced Plone themes
Building instant features with advanced Plone themesBuilding instant features with advanced Plone themes
Building instant features with advanced Plone themesAsko Soukka
 
Nix for Python developers
Nix for Python developersNix for Python developers
Nix for Python developersAsko Soukka
 
Acceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and seleniumAcceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and seleniumAsko Soukka
 

Plus de Asko Soukka (9)

Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Embedding BPMN-driven business processes into Plone
Embedding BPMN-driven business processes into PloneEmbedding BPMN-driven business processes into Plone
Embedding BPMN-driven business processes into Plone
 
Plone and Volto in a Jamstack project
Plone and Volto in a Jamstack projectPlone and Volto in a Jamstack project
Plone and Volto in a Jamstack project
 
Deploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayDeploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard Way
 
How Plone Excels in GatsbyJS Content Mesh
How Plone Excels in GatsbyJS Content MeshHow Plone Excels in GatsbyJS Content Mesh
How Plone Excels in GatsbyJS Content Mesh
 
ZServer Reloaded with HTTP/2 and WebSocket Support
ZServer Reloaded with HTTP/2 and WebSocket SupportZServer Reloaded with HTTP/2 and WebSocket Support
ZServer Reloaded with HTTP/2 and WebSocket Support
 
Building instant features with advanced Plone themes
Building instant features with advanced Plone themesBuilding instant features with advanced Plone themes
Building instant features with advanced Plone themes
 
Nix for Python developers
Nix for Python developersNix for Python developers
Nix for Python developers
 
Acceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and seleniumAcceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and selenium
 

Plone, rabbit mq and messaging that just works