Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Reactive Internet of Things : the Vert.x way

Slides from the Meetup in Rome on March 16th hosted by meet{cast} and Codemotion. Introduction on Vert.x and related internals. Description of the main Vert.x components IoT oriented, like MQTT server, AMQP Proton and Kafka client. Show main real use cases like Eclipse Hono and EnMasse projects.

  • Identifiez-vous pour voir les commentaires

Reactive Internet of Things : the Vert.x way

  1. 1. Meet{cast} powered by Paolo Patierno Senior Software Engineer (Messaging & IoT) @ Red Hat @ppatierno Reactive Internet of Things : the Vert.x way
  2. 2. powered by Senior Software Engineer @ Red Hat Messaging & IoT team Microsoft MVP Embedded & IoT (… I like to call it in this way …) Eclipse committer Hono (lead as well) Paho I love everything is open … code, standards, protocols, … … even pizza, running, MotoGP :-) Who am I ?
  3. 3. powered by What is Vert.x ? Vert.x IoT “enabled” components MQTT server AMQP Proton Kafka client Use cases Eclipse Hono EnMasse Agenda
  4. 4. powered by Vert.x is a toolkit ... … for building distributed and reactive applications ... … running on a JVM ... … using an asynchronous non-blocking model … … and it’s polyglot ! What is Vert.x
  5. 5. powered by Vert.x (Core) is just a JAR Vert.x components are just JARs Your application has just some JAR dependencies (classpath, fat-jar, ...) Toolkit
  6. 6. powered by Different (micro)services inside your network which ... is not reliable has a latency has a finite bandwidth The topology can change Be prepared to fail ! Distributed
  7. 7. powered by Responsive : respond in a acceptable time Elastic : scale up and down Resilient : designed to handle failures gracefully Message driven : interact using asynchronous messages http://www.reactivemanifesto.org Reactive responsive elastic resilient message driven
  8. 8. powered by Java Groovy Ruby JavaScript (Nashorn) Ceylon Kotlin Scala Polyglot
  9. 9. powered by The Event Loop
  10. 10. powered by Multiple Event Loops
  11. 11. powered by Non blocking I/O … vs blocking
  12. 12. powered by Scalability
  13. 13. powered by A piece of code that can be deployed by Vert.x Similarities with the Actor Model, where you can think a verticle as an actor Verticles communicate using an “event bus” They are optional Verticles
  14. 14. powered by Communication system within Vert.x Different components can communicate using it ... sending and receiving messages (one way, request/reply, publish/subscribe) whatever the language is (polyglot) wherever they run (even not on Vert.x, thanks to “bridges”) Main topics : message : with a body and headers, JSON encoded address : messages are sent to an address handler : messages are received by handlers Event Bus
  15. 15. powered by Event Bus point to point publish/subscribe request/reply
  16. 16. powered by Event Bus clustered bridges
  17. 17. powered by An IoT solution is distributed “by nature” Having a toolkit means using only what you need in each piece IoT applications need to be reactive responsive, elastic scale, reliable and asynchronous Different teams (or companies ?) ... … with different know-how … need to be polyglot Vert.x & the Internet of Things
  18. 18. powered by It’s not a broker ! Provides a server for handling connection requests from remote MQTT clients handling all the communication, encoding/decoding on the wire handling message exchanges as defined by the protocol (3.1.1) The API provides : events raised when raw protocol messages are received methods for sending messages to remote clients MQTT server
  19. 19. powered by Provides a wrapper around Apache Qpid Proton AMQP 1.0 protocol engine The API provides : client for connecting to an AMQP 1.0 server/broker handling of sessions and links inside a connection send/receive messages, flow control … all great AMQP 1.0 stuff :-) server for accepting connections from AMQP 1.0 clients AMQP Proton
  20. 20. powered by Provides a Kafka client for reading/sending messages from/to an Apache Kafka cluster The API provides : subscribing to a topic as part of a consumer group assigning specific topic partition sending messages to a topic using a shared producer Kafka client
  21. 21. powered by Tailored general messaging for IoT solutions Provide messaging APIs for common operations Support multiple IoT protocols (MQTT, AMQP, HTTP, LWM2M,...) Support different underlying messaging infrastracture : Qpid Dispatch Router + ActiveMQ Artemis JMS EnMasse Kafka RabbitMQ Eclipse Hono
  22. 22. powered by IoT messaging APIs telemetry : used by devices to send data downstream device registration : register, deregister and get information about devices event : used by devices to send events downstream (i.e. alarms, ...) command & control : used by business applications to send commands to devices IoT protocol adapters HTTP REST MQTT Scalable messaging architecture Eclipse Hono
  23. 23. powered by Eclipse Hono … and Vert.x ?
  24. 24. powered by A MaaS (Message as a Service) platform Elastic scale messaging based on Qpid Dispatch Router and Artemis running on OpenShift Support different communication patterns store and forward : queue & topic/subscriptions direct messaging : anycast & multicast Support different protocols AMQP 1.0, MQTT, HTTP, Stomp Multitenancy EnMasse
  25. 25. powered by EnMasse address controller ragent configserv queue scheduler mqtt gateway mqtt lwt subserv messaging mqtt-gateway mqtt-lwt subscription myqueue mytopic admin clientsapplication developer OpenShift services
  26. 26. powered by Target IoT Platform Linux containers, Kubernetes, OpenShift BrokerBroker AMQP-Kafka Adapters AMQP-Spark Adapters AMQP MQTT, HTTP, CoAP, … AMQP MQTT, HTTP, CoAP, … Dispatch Router
  27. 27. powered by Vert.x : http://vertx.io Vert.x MQTT server : https://github.com/vert-x3/vertx-mqtt-server Vert.x AMQP Proton : https://github.com/vert-x3/vertx-proton Vert.x Kafka client : https://github.com/vert-x3/vertx-kafka-client Eclipse Hono : https://www.eclipse.org/hono/ EnMasse : https://github.com/EnMasseProject ActiveMQ Artemis : https://activemq.apache.org/artemis/ Qpid Dispatch Router : http://qpid.apache.org/components/dispatch-router/ Apache Kafka : https://kafka.apache.org/ AMQP-Kafka bridge : https://github.com/EnMasseProject/amqp-kafka-bridge Paolo Patierno’s blog : https://paolopatierno.wordpress.com/ :-) Resources
  28. 28. powered by If you like Vert.x ! If you are a student ! Google Summer of Code ideas using Vert.x : http://vertx.io/gsoc/ Google Summer of Code
  29. 29. powered by Thanks ! ppatierno