Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Messaging as a service : building a scalable messaging service

1,579 views

Published on

What is "messaging"? Is it useable only on premise or even in the cloud? During this day/session, we will have a brief introduction around "messaging" with related patterns, interoperability problems and the main components like brokers and routers which make it possible. After that, we'll see how it's possible to develop a "message as a service" platform running into the cloud addressing all configuration and scalability problems. This journey will be driven by the EnMasse project, an open source cloud messaging platform able to run on Kubernetes and OpenShift.

Published in: Software
  • Be the first to comment

Messaging as a service : building a scalable messaging service

  1. 1. Messaging-as-a-Service Building a scalable messaging service Paolo Patierno Senior Software Engineer @ Red Hat 22/05/2017
  2. 2. INSERT DESIGNATOR, IF NEEDED2 Who am I ? @ppatierno ● Senior Software Engineer @ Red Hat ○ Messaging & IoT team ● Lead/Committer @ Eclipse Foundation ○ Hono, Paho and Vert.x projects ● Microsoft MVP ● Technologies and protocols “globetrotter” ● Hacking low constrained devices in spare time ● Blogger and speaker about distributed systems, messaging, IoT and embedded “world”
  3. 3. INSERT DESIGNATOR, IF NEEDED3 Agenda ● Messaging … what ? ● Messaging … in the cloud ● EnMasse : the open source MaaS ! ○ Architecture & Features ○ Scalability ○ Configuration ○ CI/CD pipeline ○ User experience ● Messaging & IoT
  4. 4. INSERT DESIGNATOR, IF NEEDED4 What is messaging not?
  5. 5. INSERT DESIGNATOR, IF NEEDED5 ● It’s about messages exchange ○ Internally in distributed systems ○ Externally between systems ● Communication at the application level ● Messages go from sender/producer/publisher to receiver/consumer/subscriber ○ Asynchronously ○ Time decoupling ○ … or directly and synchronously What is messaging?
  6. 6. INSERT DESIGNATOR, IF NEEDED6 Messaging patterns C S P S S S msg X msg X msg X P C C C msg X msg Y msg Z Request/Response Publish/Subscribe Competing Consumers msg req msg resp
  7. 7. INSERT DESIGNATOR, IF NEEDED7 Quality of Service P C At Most Once At Least Once Exactly Once msg X P C msg Y P C msg Z P C msg X P C msg Y P C msg Y P C msg X P C msg Y P C msg Z
  8. 8. INSERT DESIGNATOR, IF NEEDED8 Interoperability Open standards AMQP 1.0 MQTT HTTP CoAP XMPP STOMP
  9. 9. INSERT DESIGNATOR, IF NEEDED9 ● Microsoft Azure ○ Service Bus ○ Event Hub ● Amazon Web Services ○ Simple Queue Service (SQS) ● Google ○ FireBase Cloud Messaging ● Confluent ○ Apache Kafka as a Service Messaging in the cloud
  10. 10. INSERT DESIGNATOR, IF NEEDED10 ● They are not open source ! ● Freedom of choice ○ On-premise or in the cloud ○ Ability to choose which cloud ○ Open Standards protocols allows users to choose client freely ● Migrating from one to the other can be complex Cloud provider limitations
  11. 11. INSERT DESIGNATOR, IF NEEDED11 ● Open source cloud messaging running on Kubernetes and OpenShift ● enmasse.io EnMasse Messaging-as-a-Service
  12. 12. INSERT DESIGNATOR, IF NEEDED12 ● Multiple communication patterns: request/response, publish/subscribe and competing consumers ● Support for “store and forward” and direct messaging mechanisms ● Scale and elasticity of message brokers ● AMQP 1.0 and MQTT support ● Simple setup, management and monitoring ● Multitenancy: manage multiple independent instances ● Deploy “on premise” or in the cloud EnMasse Features
  13. 13. INSERT DESIGNATOR, IF NEEDED13 ● Authentication and authorization ● Service broker API ● HTTP(S) ● Message grouping ● Distributed transactions ● Message ordering ● Multiple flavors ○ Apache Kafka ● ... EnMasse Coming features
  14. 14. INSERT DESIGNATOR, IF NEEDED14 Basic idea R R R P C B B
  15. 15. INSERT DESIGNATOR, IF NEEDED15 Routing vs “Broking” Broker Producer Broker Consumer Send message Accepted Send message Accepted
  16. 16. INSERT DESIGNATOR, IF NEEDED16 Routing vs “Broking” Router Producer Router Consumer Send message Accepted Send message Accepted
  17. 17. INSERT DESIGNATOR, IF NEEDED17 Architecture
  18. 18. INSERT DESIGNATOR, IF NEEDED MQTT over AMQP 18 ● MQTT gateway ○ Handles connections with remote MQTT clients ○ Bridges MQTT - AMQP protocols ● MQTT lwt ○ Provides the “will testament” feature ○ In charge to recover & send the “will” if client dies ● It brings MQTT features over AMQP so … ○ … “will testament” works for AMQP clients as well
  19. 19. INSERT DESIGNATOR, IF NEEDED19 Scaling (routers and brokers)
  20. 20. INSERT DESIGNATOR, IF NEEDED20 Scaling routers R R R R A
  21. 21. INSERT DESIGNATOR, IF NEEDED21 Scaling routers (#2) R R R R A
  22. 22. INSERT DESIGNATOR, IF NEEDED Scaling brokers 22 a a b b Router network
  23. 23. INSERT DESIGNATOR, IF NEEDED Adding brokers 23 a a b b Router network a
  24. 24. INSERT DESIGNATOR, IF NEEDED Removing brokers 24 a a b b Router network a
  25. 25. INSERT DESIGNATOR, IF NEEDED25 Configuration management
  26. 26. INSERT DESIGNATOR, IF NEEDED26 Configuration distribution
  27. 27. INSERT DESIGNATOR, IF NEEDED27 Configuration interface { "apiVersion": "v3", "kind": "Address", "metadata": { "name": "myqueue" }, "spec": { "store_and_forward": true, "multicast": false, "flavor": "vanilla-queue" } }
  28. 28. INSERT DESIGNATOR, IF NEEDED { "apiVersion": "v3", "kind": "Flavor", "metadata": { "name": "vanilla-queue" }, "spec": { "type": "queue", "Description": "Simple in-memory queue", "templateName": "queue-inmemory", "templateParameters": {} } } 28 Configuration interface
  29. 29. INSERT DESIGNATOR, IF NEEDED29 Continuous integration
  30. 30. INSERT DESIGNATOR, IF NEEDED Continuous integration 30 Component build pipeline build test Build docker image & push success failure trigger systemtests
  31. 31. INSERT DESIGNATOR, IF NEEDED31 User interface
  32. 32. INSERT DESIGNATOR, IF NEEDED OpenShift console 32
  33. 33. INSERT DESIGNATOR, IF NEEDED Messaging console 33 ●
  34. 34. INSERT DESIGNATOR, IF NEEDED34 Monitoring
  35. 35. INSERT DESIGNATOR, IF NEEDED35 “give me a scalable messaging platform, and I shall move the Internet of Things world” (Archimedes) Messaging & IoT
  36. 36. INSERT DESIGNATOR, IF NEEDED36 IoT communication patterns Telemetry Inquiries Commands Notifications
  37. 37. INSERT DESIGNATOR, IF NEEDED37 IoT communication patterns Messaging patterns & protocols ● Telemetry & Notifications are about … ○ …. messaging publish/subscribe ● Commands & Inquiries are about … ○ … messaging request/response ● Different protocols (AMQP, MQTT, HTTP, …) implement them in different way ○ As built-in support … ○ … or on top of it at application level ○ Read more on “Strengths And Weaknesses Of IoT Communication Patterns” * * DZone IoT Guide : https://dzone.com/guides/iot-applications-protocols-and-best-practices
  38. 38. INSERT DESIGNATOR, IF NEEDED AMQP 1.0 38 Eclipse Hono API Endpoints Auth Service Device Registry Protocol Adapters Business Applications Devices Devices AMQP 1.0 AMQP 1.0 AMQP 1.0 HTTP, MQTT
  39. 39. INSERT DESIGNATOR, IF NEEDED39 DEMO
  40. 40. INSERT DESIGNATOR, IF NEEDED Resources 40 ● EnMasse : https://enmasseproject.github.io/ ● Qpid Dispatch Router : http://qpid.apache.org/components/dispatch-router/ ● ActiveMQ Artemis : https://activemq.apache.org/artemis/ ● Eclipse Hono : https://www.eclipse.org/hono/ ● Demo : https://github.com/ppatierno/devday-maas ● My blog : https://paolopatierno.wordpress.com/
  41. 41. Thank you ! Questions ? @ppatierno

×