SlideShare uma empresa Scribd logo
1 de 14
How RedDwarf Uses RabbitMQ

           Hong Yuan
      HPCloud OaaS & DaaS
RabbitMQ Basics Refresh
 Queue
   Store messages in order
 Exchange
   Routing table to map routing keys with queues
 Routing Key
   String/pattern used to look up queues to talk
 Channel
   Exchange + Queue + Routing Key
RedDwarf RPC the Messaging Library
 RedDwarf RPC library wraps up RabbitMQ messaging
  modules and provides 2 + 1 messaging models
 RPC.cast
    Asynchronous call with no waiting for response
    One-way from API Server to Smart Agent
 RPC.call
    Synchronous call waiting for response
    Round trip from API Server to Smart Agent
 RPC.listen
    Asynchronous call with no waiting for response
    One-way from API Server to Smart Agent
    Smart Agent cannot use RPC.cast as it is independent of
     RedDwarf code base
Asynchronous Call (rpc.cast)
 On the API Server side, a MQ publisher is
  instantiated to send the message to a topic exchange
    Exchange name = “nova”
    Routing key = hostname
 On the Smart Agent side, the message is fetched by a
  MQ consumer and passed to the Worker in charge
  of the task
    Exchange name = “nova”
    Routing key = hostname
Asynchronous Call (rpc.cast)

                                        Hostname =
                          Routing Key    “host1”
API Server 1                            SmartAgent
                               =
               Exchange     “host1”

                          Routing Key   Hostname =
               Name =
API Server 2                   =         “host2”
               “Nova”
                            “host2”     SmartAgent
               Type =
               “topic”    Routing Key
                               =
                                        Hostname =
API Server N               “hostN”
                                         “hostN”
                                        SmartAgent
Synchronous Call (rpc.call)
 RedDwarf API, rpc.call()
    Send and Wait
    Response required
    Two-way between API and Smart Agent
 One Topic Publisher instantiated to send the message request to
  MQ; Meanwhile, one Direct Consumer is instantiated to wait for the
  response message.
 On the other end, the message is consumed by one Topic Consumer
  dictated by the routing key (such as Instance ID or hostname)
 Once the task is completed, one Direct Publisher is allocated to
  send the response message to MQ
 One Direct Consumer dictated by the routing key (such as 'msg_id')
  on the rpc.call Sender side consumes the response message.
 The direct exchange and queue identifiers are determined by a
  UUID generator, and are marshaled in the request message
 The direct channel’s life-cycle is limited to the message delivery
Synchronous Call (rpc.call)
                          Routing Key
                               =
                                        Hostname =
API Server 1                “host1”
                 Topic                   “host1”
 Message       Exchange   Routing Key   SmartAgent
UUID =1234                     =
                Name =      “host2”
                “Nova”                  Hostname =
                          Routing Key    “host2”
API Server 2                   =        SmartAgent
                           “hostN”

                Direct                  Hostname =
               Exchange   Routing Key    “hostN”
API Server N
                               =        SmartAgent
                Name =      “1234”
                “1234”
Phone-Home Call from SmartAgent
 Asynchronous call from Smart Agent to API Server
 HPCS extension to RedDwarf RPC library
 Phone-Home as new use cases
   API Server has no idea how long to complete instance
    creation
   Need Smart Agent to automatically phone home for
    updating the instance state when it’s done
 Background listener to passively waiting on MQ for
  Smart Agent’s phone home messages
 A direct consumer is instantiated at the API Sever at
  its starting time
Phone-Home Call (rpc.listen)

                                                Hostname =
                                                 “host1”
API Server 1                                    SmartAgent

                                Exchange
                Routing Key                     Hostname =
API Server 2         =           Name =          “host2”
               “phonehome”    “phonehome”       SmartAgent
                              Type = “direct”

                                                Hostname =
API Server N                                     “hostN”
                                                SmartAgent
Topic Publisher
 Topic Publisher used for both rpc.call() and rpc.cast()
 Instantiated and used to push a message to the RabbitMQ
 Every publisher connects always to the same topic-based
  exchange
 Life-cycle is limited to the message delivery
Topic Consumer
• Used to receive messages from RabbitMQ sent by both
  rpc.call and rpc.cast
• Instantiated by Agent instance and exists throughout
  Agent instance’s life-cycle
• Connects to the same topic-based exchange either via
  a shared queue or via a unique exclusive queue
• Every Agent has two topic consumers
   – One for rpc.cast and it connects to a shared queue
   – One for rpc.call and it connects to a unique queue
• Used by Agent to invoke the appropriate action based
  on the request coming in
Direct Consumer
 Used for receiving the response message from Agent
 Comes to life only when rpc.call operation is executed
 Instantiated and used to receive response message
  from the queuing system
 Every consumer connects to a unique direct-based
  exchange via a unique exclusive queue named by
  message UUID
 Life-cycle of the queue limited to the message delivery
 The exchange and queue identifiers are determined by
  a UUID generator, and are marshaled in the message
  sent by the Topic Publisher (only rpc.call operations)
Direct Publisher
• Used by Agent Server to return the message required
  by the request operation
• Comes to life only during rpc.call operations
• Connects to a direct-based exchange whose identity
  is dictated by the incoming message UUID
• Life-cycle is limited to the message delivery
Topic Exchange
• On RabbitMQ Server
• The Exchange is a routing table that exists in
  the context of a virtual host (the multi-
  tenancy mechanism provided by RabbitMQ);
  its type (such as topic vs. direct) determines
  the routing policy; a RabbitMQ node will have
  only one topic-based exchange for every topic
  in Nova.

Mais conteúdo relacionado

Destaque

Evented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPEvented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPmarkstory
 
Webinar Slides: Real time Recommendations with Redis, Java and Websockets
Webinar Slides: Real time Recommendations with Redis, Java and WebsocketsWebinar Slides: Real time Recommendations with Redis, Java and Websockets
Webinar Slides: Real time Recommendations with Redis, Java and WebsocketsRedis Labs
 
Node and Micro-Services at IBM
Node and Micro-Services at IBMNode and Micro-Services at IBM
Node and Micro-Services at IBMDejan Glozic
 
%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
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoTareque Hossain
 
12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM DeploymentJoe Kutner
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsHoucheng Lin
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQJames Carr
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffJAX London
 
Micro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factorsMicro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factorsDejan Glozic
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
MapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and ReactMapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and ReactGeoSolutions
 

Destaque (16)

Evented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPEvented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHP
 
Webinar Slides: Real time Recommendations with Redis, Java and Websockets
Webinar Slides: Real time Recommendations with Redis, Java and WebsocketsWebinar Slides: Real time Recommendations with Redis, Java and Websockets
Webinar Slides: Real time Recommendations with Redis, Java and Websockets
 
Reducing load with RabbitMQ
Reducing load with RabbitMQReducing load with RabbitMQ
Reducing load with RabbitMQ
 
Node and Micro-Services at IBM
Node and Micro-Services at IBMNode and Micro-Services at IBM
Node and Micro-Services at IBM
 
%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
 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment
 
Art Of Message Queues
Art Of Message QueuesArt Of Message Queues
Art Of Message Queues
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
 
Micro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factorsMicro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factors
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
MapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and ReactMapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and React
 

Semelhante a Red dwarf&rabbit

MessagePack Rakuten Technology Conference 2010
MessagePack Rakuten Technology Conference 2010MessagePack Rakuten Technology Conference 2010
MessagePack Rakuten Technology Conference 2010Sadayuki Furuhashi
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCTim Burks
 
Feb 2013 HUG: Large Scale Data Ingest Using Apache Flume
Feb 2013 HUG: Large Scale Data Ingest Using Apache FlumeFeb 2013 HUG: Large Scale Data Ingest Using Apache Flume
Feb 2013 HUG: Large Scale Data Ingest Using Apache FlumeYahoo Developer Network
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using javaUC San Diego
 
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Apigee | Google Cloud
 

Semelhante a Red dwarf&rabbit (7)

MessagePack Rakuten Technology Conference 2010
MessagePack Rakuten Technology Conference 2010MessagePack Rakuten Technology Conference 2010
MessagePack Rakuten Technology Conference 2010
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
 
RIPP Notes
RIPP NotesRIPP Notes
RIPP Notes
 
Feb 2013 HUG: Large Scale Data Ingest Using Apache Flume
Feb 2013 HUG: Large Scale Data Ingest Using Apache FlumeFeb 2013 HUG: Large Scale Data Ingest Using Apache Flume
Feb 2013 HUG: Large Scale Data Ingest Using Apache Flume
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
 

Último

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Último (20)

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

Red dwarf&rabbit

  • 1. How RedDwarf Uses RabbitMQ Hong Yuan HPCloud OaaS & DaaS
  • 2. RabbitMQ Basics Refresh  Queue  Store messages in order  Exchange  Routing table to map routing keys with queues  Routing Key  String/pattern used to look up queues to talk  Channel  Exchange + Queue + Routing Key
  • 3. RedDwarf RPC the Messaging Library  RedDwarf RPC library wraps up RabbitMQ messaging modules and provides 2 + 1 messaging models  RPC.cast  Asynchronous call with no waiting for response  One-way from API Server to Smart Agent  RPC.call  Synchronous call waiting for response  Round trip from API Server to Smart Agent  RPC.listen  Asynchronous call with no waiting for response  One-way from API Server to Smart Agent  Smart Agent cannot use RPC.cast as it is independent of RedDwarf code base
  • 4. Asynchronous Call (rpc.cast)  On the API Server side, a MQ publisher is instantiated to send the message to a topic exchange  Exchange name = “nova”  Routing key = hostname  On the Smart Agent side, the message is fetched by a MQ consumer and passed to the Worker in charge of the task  Exchange name = “nova”  Routing key = hostname
  • 5. Asynchronous Call (rpc.cast) Hostname = Routing Key “host1” API Server 1 SmartAgent = Exchange “host1” Routing Key Hostname = Name = API Server 2 = “host2” “Nova” “host2” SmartAgent Type = “topic” Routing Key = Hostname = API Server N “hostN” “hostN” SmartAgent
  • 6. Synchronous Call (rpc.call)  RedDwarf API, rpc.call()  Send and Wait  Response required  Two-way between API and Smart Agent  One Topic Publisher instantiated to send the message request to MQ; Meanwhile, one Direct Consumer is instantiated to wait for the response message.  On the other end, the message is consumed by one Topic Consumer dictated by the routing key (such as Instance ID or hostname)  Once the task is completed, one Direct Publisher is allocated to send the response message to MQ  One Direct Consumer dictated by the routing key (such as 'msg_id') on the rpc.call Sender side consumes the response message.  The direct exchange and queue identifiers are determined by a UUID generator, and are marshaled in the request message  The direct channel’s life-cycle is limited to the message delivery
  • 7. Synchronous Call (rpc.call) Routing Key = Hostname = API Server 1 “host1” Topic “host1” Message Exchange Routing Key SmartAgent UUID =1234 = Name = “host2” “Nova” Hostname = Routing Key “host2” API Server 2 = SmartAgent “hostN” Direct Hostname = Exchange Routing Key “hostN” API Server N = SmartAgent Name = “1234” “1234”
  • 8. Phone-Home Call from SmartAgent  Asynchronous call from Smart Agent to API Server  HPCS extension to RedDwarf RPC library  Phone-Home as new use cases  API Server has no idea how long to complete instance creation  Need Smart Agent to automatically phone home for updating the instance state when it’s done  Background listener to passively waiting on MQ for Smart Agent’s phone home messages  A direct consumer is instantiated at the API Sever at its starting time
  • 9. Phone-Home Call (rpc.listen) Hostname = “host1” API Server 1 SmartAgent Exchange Routing Key Hostname = API Server 2 = Name = “host2” “phonehome” “phonehome” SmartAgent Type = “direct” Hostname = API Server N “hostN” SmartAgent
  • 10. Topic Publisher  Topic Publisher used for both rpc.call() and rpc.cast()  Instantiated and used to push a message to the RabbitMQ  Every publisher connects always to the same topic-based exchange  Life-cycle is limited to the message delivery
  • 11. Topic Consumer • Used to receive messages from RabbitMQ sent by both rpc.call and rpc.cast • Instantiated by Agent instance and exists throughout Agent instance’s life-cycle • Connects to the same topic-based exchange either via a shared queue or via a unique exclusive queue • Every Agent has two topic consumers – One for rpc.cast and it connects to a shared queue – One for rpc.call and it connects to a unique queue • Used by Agent to invoke the appropriate action based on the request coming in
  • 12. Direct Consumer  Used for receiving the response message from Agent  Comes to life only when rpc.call operation is executed  Instantiated and used to receive response message from the queuing system  Every consumer connects to a unique direct-based exchange via a unique exclusive queue named by message UUID  Life-cycle of the queue limited to the message delivery  The exchange and queue identifiers are determined by a UUID generator, and are marshaled in the message sent by the Topic Publisher (only rpc.call operations)
  • 13. Direct Publisher • Used by Agent Server to return the message required by the request operation • Comes to life only during rpc.call operations • Connects to a direct-based exchange whose identity is dictated by the incoming message UUID • Life-cycle is limited to the message delivery
  • 14. Topic Exchange • On RabbitMQ Server • The Exchange is a routing table that exists in the context of a virtual host (the multi- tenancy mechanism provided by RabbitMQ); its type (such as topic vs. direct) determines the routing policy; a RabbitMQ node will have only one topic-based exchange for every topic in Nova.