SlideShare a Scribd company logo
Copyright © by HiveMQ. All Rights Reserved.
Copyright © by HiveMQ. All Rights Reserved.
WELCOME
Silvio Giebl Clive Jevons
• Software Developer
@HiveMQ
• Developer and
Maintainer of the
HiveMQ MQTT Client
• Distributed & scalable
systems
• High performance and
reactive applications
• Independent Consultant
@Jevons IT
• Used the HiveMQ MQTT
Client to integrate it in a
connected car platform
• Was involved in the
development of the
HiveMQ MQTT Client
Copyright © by HiveMQ. All Rights Reserved.
What we will talk about ...
• What is an MQTT client?
→ You will learn how flexible MQTT can be used for a variety of use cases
• Why HiveMQ MQTT Client?
→ You will learn the features and the advantages
• Real world Enterprise use case of the HiveMQ MQTT Client
in a connected car platform
→ You will learn from the experience of an actual user
Copyright © by HiveMQ. All Rights Reserved.
What is MQTT?
Copyright © by HiveMQ. All Rights Reserved.
What is MQTT?
• Communication protocol
• Publish/Subscribe pattern
• OASIS and ISO Standard (ISO/IEC PRF 20922)
→ interoperability
• Decoupling of sender and receiver in space, in time
→ more robust and scalable
• QoS levels
→ reliable communication over unreliable networks
• Flexible, lightweight, dynamic topics, data agnostic
• Use cases: IoT, IIoT, Industry 4.0, Logistics, Connected Cars, ...
→ everything that links a lot of devices
Copyright © by HiveMQ. All Rights Reserved.
What is MQTT 5?
• A lot of additional features while keeping MQTT lightweight and flexible
• Many improvements making MQTT an even more versatile protocol
Copyright © by HiveMQ. All Rights Reserved.
What is an MQTT Client?
Copyright © by HiveMQ. All Rights Reserved.
What is an MQTT Client?
• MQTT is known to be used for small devices
• Actually it is used for a variety of systems
• MQTT is lightweight and does not put restrictions on applications
→ Almost everything can be an MQTT client
• Embedded: sensors, control units, ...
• Mobile/desktop: apps, browser applications, ...
• Backend: integration with other systems, databases, microservices, ...
• Different use cases, different requirements
• But all have in common that they need to communicate in a reliable way
Copyright © by HiveMQ. All Rights Reserved.
MQTT Clients for Embedded
Requirements
• Low computing power
• Low bandwidth
• High latency
• Unstable network
• Huge amount of devices, little data per device
→ All covered by MQTT
• MQTT clients are lightweight
• Minimal network overhead
• QoS guarantees
• MQTT Broker removes complexity from clients, ensures scalability
Copyright © by HiveMQ. All Rights Reserved.
MQTT Clients for Mobile
Requirements
• Platform independent
• Responsiveness, reactiveness
• Unstable network
→ All covered by MQTT
• MQTT is a wire protocol standard, so interoperable
• MQTT is push based
• QoS guarantees
Copyright © by HiveMQ. All Rights Reserved.
MQTT Clients for Backends
• Usually MQTT is used for a huge amount of clients, each handling a small
portion of the data
• Backend systems are often used for ingestion of all data for monitoring,
analytics and control
Requirements
• Scalability
• High throughput per service
• Reliability, no message loss, no overload, backpressure
→ All covered by MQTT
• Scalability is ensured by the broker
• Shared subscriptions for scaling out/load balancing MQTT clients
Copyright © by HiveMQ. All Rights Reserved.
MQTT Clients for Backends
• Shared subscriptions are especially useful for microservice like systems
• Subscribers can join/leave the shared subscription group dynamically
• Shared subscriptions are standardized with MQTT 5
(they can be supported for MQTT 3 as well)
Copyright © by HiveMQ. All Rights Reserved.
HiveMQ MQTT Client
Copyright © by HiveMQ. All Rights Reserved.
HiveMQ MQTT Client
• MQTT Client Java Library
• All MQTT 3.1.1 and MQTT 5 features (including all optional features)
• Open Source
• Different API flavors: Reactive, Asynchronous, Blocking
Key Benefits
• Reactive
• Backpressure, Stability, Reliability
• Resource efficiency, low overhead, high throughput
Copyright © by HiveMQ. All Rights Reserved.
MQTT Features
• MQTT 3 and 5: all QoS levels, retained messages, Will/LWT, ...
• MQTT 5
• Session expiry
• Message expiry
• Flow Control → better backpressure handling
• Shared subscriptions (also supported for MQTT 3)
• Payload Format Indicator and Content Type
• User properties
• Negative acknowledgements and reason strings
• Request/Response
• Topic Aliases (automatically)
• Subscription Identifiers (automatically)
• Enhanced Auth
Copyright © by HiveMQ. All Rights Reserved.
Features on top of MQTT
• TLS/SSL
• Websocket, Secure Websocket
• Automatic reconnect (automatic & configurable)
• Offline message buffering
• Thread management (automatic & configurable)
• Thread safety
• Pluggable Enhanced Auth support
• Automatic topic alias tracing and mapping
• Backpressure handling (deep integration with the reactive API)
Copyright © by HiveMQ. All Rights Reserved.
Open Source
• Source code on GitHub: https://github.com/hivemq/hivemq-mqtt-client
• Apache 2 license
• Free to use
• Actively maintained by HiveMQ
• Transparent development
• Issues and PRs on GitHub
• Feedback and contributions are welcome
• Why Open Source?
• MQTT is the standard IoT protocol
• Everybody should be able to use MQTT
Copyright © by HiveMQ. All Rights Reserved.
Example Uses
MQTT CLI
• Command Line Tool
• Debugging
• Simulating MQTT Clients
Internal: HiveMQ Device Simulator
• Simulating millions of MQTT clients with few machines
• Used to reproduce customer scenarios
• Used as a benchmark tool
Copyright © by HiveMQ. All Rights Reserved.
Why Different API Flavors?
• Enables fast prototyping
• All APIs are as simple as possible
• But starting with the blocking API is often simpler
• Only a few lines of code for MQTT communication
• Allows evolution of applications
• Asynchronous API is often enough
• Parts can be switched to reactive when scaling and more precise
backpressure control is needed
• Different API styles can be used simultaneously
• Fluent Builders also help
• Only use the features you need
• When you need more features, no need to rewrite your whole code
Copyright © by HiveMQ. All Rights Reserved.
What Does Lightweight Mean?
• Communication should not use a major part of the computing time
• Low memory usage → around 5KB per client instance
• Many clients possible
• Intelligent thread pooling
• Overhead per client is minimal
• Also possible to use 1 client by many threads → flexibility
• Recommendation: if different parts of a service are independent, use
more clients instead of sharing 1 client to avoid unnecessary
coupling
• Application messages and computations are important
Copyright © by HiveMQ. All Rights Reserved.
Embedded, Mobile, Backend
• Resource efficiency helps all use cases
• Embedded/mobile → hardware/battery restrictions
• Backend → enables higher throughput for actual processing
• Backend:
• Scaling with shared subscriptions
• Backpressure helps building more robust systems
• Mobile: Support for Android
• API 19/KitKat and up → > 96%
• Reactive API
• Mobile: responsiveness,
often used on Android
• Backend: resilience
https://developer.android.com/about/dashboards
Copyright © by HiveMQ. All Rights Reserved.
Why Reactive?
• Reactive Manifesto (https://www.reactivemanifesto.org/):
• Responsive
• Resilient
• Elastic
• Message driven
• Reactive is the solution for high scale applications
• Perfect fit for MQTT
Copyright © by HiveMQ. All Rights Reserved.
Why Reactive?
• HiveMQ MQTT Client is reactive
• In its core
• Has a reactive API using RxJava which follows the reactive streams
specification
• Interoperable with other reactive libraries (interoperability is not only
important for the MQTT protocol, but also the libraries)
• Barrier of entry:
• You have to learn new concepts, think differently
• Good news: you can start with the asynchronous API and move to
reactive later
Copyright © by HiveMQ. All Rights Reserved.
What is Backpressure?
• Mechanism to adapt message rates in an asynchronous system
• If an application is overwhelmed by too many messages
• It might crash
• It might drop important messages (without other applications/the
broker even knowing)
• A lot of unnecessary work is done when dropping messages
• Backpressure lets the application that produces too many messages know,
that they can not be handled → appropriate and early actions can be taken
• When using shared subscriptions the load can be better balanced between
all clients in the group
• → Backpressure improves resilience and robustness
• MQTT 5 Flow Control limits concurrent unacknowledged messages
Copyright © by HiveMQ. All Rights Reserved.
API Design
"APIs should be easy to use and hard to misuse. It should be
easy to do simple things; possible to do complex things; and
impossible, or at least difficult, to do wrong things."
(Joshua Bloch)
• The HiveMQ MQTT Client gives you full control over all MQTT features
• It is not a restrictive framework
• But using sensible defaults, you do not have to configure everything
• The context sensitive fluent builder pattern used throughout the library
enables short concise code but highly customizable
Copyright © by HiveMQ. All Rights Reserved.
Code examples
Copyright © by HiveMQ. All Rights Reserved.
Setup
dependencies {
implementation group: 'com.hivemq', name: 'hivemq-mqtt-client', version: '1.1.3'
}
<dependencies>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client</artifactId>
<version>1.1.3</version>
</dependency>
</dependencies>
Maven Central, JCenter, JitPack
Copyright © by HiveMQ. All Rights Reserved.
Client configuration
Mqtt5Client client1 = Mqtt5Client.builder().build();
Mqtt5Client client2 = Mqtt5Client.builder()
.identifier("client2")
.serverHost("broker.hivemq.com")
.serverPort(1234)
.sslWithDefaultConfig()
.webSocketWithDefaultConfig()
.automaticReconnectWithDefaultConfig()
.addConnectedListener(context -> System.out.println("connected"))
.addDisconnectedListener(context -> System.out.println("disconnected"))
.build();
Copyright © by HiveMQ. All Rights Reserved.
Client configuration
Mqtt5Client client3 = Mqtt5Client.builder()
.identifier("client3")
.transportConfig()
.serverHost("broker.hivemq.com")
.serverPort(1234)
.sslConfig()
.protocols(Arrays.asList("TLSv1.3"))
.cipherSuites(Arrays.asList("TLS_AES_128_GCM_SHA256"))
.trustManagerFactory(myTrustManager)
.keyManagerFactory(myKeyManager)
.applySslConfig()
.webSocketConfig()
.serverPath("mqtt")
.subprotocol("mqtt")
.applyWebSocketConfig()
.applyTransportConfig()
...
Copyright © by HiveMQ. All Rights Reserved.
Client configuration
...
.automaticReconnect()
.initialDelay(100, TimeUnit.MILLISECONDS)
.maxDelay(10, TimeUnit.SECONDS)
.applyAutomaticReconnect()
.addDisconnectedListener(context -> {
context.getReconnector().reconnectWhen(
getOAuthToken(),
(token, throwable) -> {
((Mqtt5ClientDisconnectedContext) context).getReconnector()
.connectWith()
.simpleAuth().password(token).applySimpleAuth()
.applyConnect();
});
})
...
Copyright © by HiveMQ. All Rights Reserved.
Client configuration
...
.simpleAuth()
.username("username")
.password("password".getBytes())
.applySimpleAuth()
.willPublish()
.topic("will")
.qos(MqttQos.AT_LEAST_ONCE)
.payload("hello world".getBytes())
.messageExpiryInterval(10)
.payloadFormatIndicator(Mqtt5PayloadFormatIndicator.UTF_8)
.contentType("text/plain")
.userProperties()
.add("time", System.currentTimeMillis() + "ms")
.add("sender", "client3")
.applyUserProperties()
.applyWillPublish()
.build();
Copyright © by HiveMQ. All Rights Reserved.
Simple Publish & Subscribe
client.connect();
client.publishWith()
.topic("demo/topic")
.qos(MqttQos.EXACTLY_ONCE)
.payload("hello world".getBytes())
.send();
client.disconnect();
client.connect();
client.toAsync().subscribeWith()
.topicFilter("demo/#")
.callback(System.out::println)
.send();
client.disconnect();
Copyright © by HiveMQ. All Rights Reserved.
Async Publish
Mqtt5AsyncClient async = client.toAsync();
async.connect()
.thenCompose(connAck -> async.publishWith()
.topic("demo/topic")
.qos(MqttQos.EXACTLY_ONCE)
.send())
.thenCompose(publishResult -> async.disconnect());
Copyright © by HiveMQ. All Rights Reserved.
MQTT 5 Features
client.connectWith()
.cleanStart(false) // resume a previous session
.sessionExpiryInterval(30) // keep session state for 30s
.restrictions()
.receiveMaximum(10) // receive max. 10 concurrent messages
.sendMaximum(10) // send max. 10 concurrent messages
.maximumPacketSize(10_240) // receive messages with max size of 10KB
.sendMaximumPacketSize(10_240) // send messages with max size of 10KB
.topicAliasMaximum(0) // the server should not use topic aliases
.sendTopicAliasMaximum(8) // use up to 8 aliases for the most used topics
.applyRestrictions()
.send();
Copyright © by HiveMQ. All Rights Reserved.
MQTT 5 Features
client.publishWith()
.topic("demo/topic")
.qos(MqttQos.EXACTLY_ONCE)
.payload("hello world".getBytes())
.retain(true)
.payloadFormatIndicator(Mqtt5PayloadFormatIndicator.UTF_8)
.contentType("text/plain") // our payload is text
.messageExpiryInterval(120) // not so important, expire after 2min if can not be delivered
.responseTopic("demo/response")
.correlationData("1234".getBytes())
.userProperties() // add some user properties to the message
.add("sender", "client1")
.add("receiver", "you")
.applyUserProperties()
.send();
Copyright © by HiveMQ. All Rights Reserved.
Reactive Request/Response
Flowable<Mqtt5Publish> requestStream = client.toRx()
.subscribeStreamWith()
.topicFilter("request/topic")
.applySubscribe();
Flowable<Mqtt5PublishResult> responseStream = client.toRx()
.publish(requestStream
.filter(requestPublish -> checkIfResponsible(requestPublish))
.observeOn(Schedulers.computation())
.map(requestPublish -> Mqtt5Publish.builder()
.topic(requestPublish.getResponseTopic().get())
.qos(requestPublish.getQos())
.payload(performComputation(requestPublish.getPayload()))
.correlationData(requestPublish.getCorrelationData().orElse(null))
.build()));
responseStream.subscribe();
Copyright © by HiveMQ. All Rights Reserved.
Reactive Android Example
client1.toRx()
.subscribeStreamWith()
.topicFilter("chat1/messages/#")
.applySubscribe()
.observeOn(AndroidSchedulers.mainThread())
.doOnNext(message -> addMessageToUi(message))
.observeOn(AndroidSchedulers.from(backgroundLooper))
.filter(message -> isImportant(message))
.doOnNext(message -> createNotification(message))
.subscribe();
Copyright © by HiveMQ. All Rights Reserved.
Use of MQTT Clients in a
Connected Car Platform
Copyright © by HiveMQ. All Rights Reserved.
Use Cases
1) Mirroring fleet data between clusters
2) Integrating HiveMQ Client into communication middleware
joynr
3) Using HiveMQ Client for processing data from a production
plant
Copyright © by HiveMQ. All Rights Reserved.
Resources
MQTT Essentials Series
Evaluate HiveMQ Broker
Try HiveMQ Cloud for Free
Get Started with MQTT
MQTT at OASIS
ANY
QUESTIONS?
Reach out to community.hivemq.com
THANK YOU
Stay updated on upcoming webinars
Subscribe to our Newsletter!

More Related Content

Similar to Building Scalable & Reliable MQTT Clients for Enterprise Computing

HiveMQ + Kafka: The ideal solution for IoT MQTT data integration
HiveMQ + Kafka: The ideal solution for IoT MQTT data integrationHiveMQ + Kafka: The ideal solution for IoT MQTT data integration
HiveMQ + Kafka: The ideal solution for IoT MQTT data integration
MargarethaErber
 
MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT
MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT
MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT
Dominik Obermaier
 
HiveMQ + Kafka - The Ideal Solution for IoT MQTT Data Integration
HiveMQ + Kafka - The Ideal Solution for IoT MQTT Data IntegrationHiveMQ + Kafka - The Ideal Solution for IoT MQTT Data Integration
HiveMQ + Kafka - The Ideal Solution for IoT MQTT Data Integration
HiveMQ
 
How mqtt 5 makes difficult io t use cases possible
How mqtt 5 makes difficult io t use cases possibleHow mqtt 5 makes difficult io t use cases possible
How mqtt 5 makes difficult io t use cases possible
Florian Raschbichler
 
Machine to Machine Communication with Microsoft Azure IoT Edge & HiveMQ
Machine to Machine Communication with Microsoft Azure IoT Edge & HiveMQMachine to Machine Communication with Microsoft Azure IoT Edge & HiveMQ
Machine to Machine Communication with Microsoft Azure IoT Edge & HiveMQ
HiveMQ
 
How MQTT 5 Makes Difficult IoT Use Cases Possible
How MQTT 5 Makes Difficult IoT Use Cases PossibleHow MQTT 5 Makes Difficult IoT Use Cases Possible
How MQTT 5 Makes Difficult IoT Use Cases Possible
HiveMQ
 
HiveMQ Cloud Webinar
HiveMQ Cloud WebinarHiveMQ Cloud Webinar
HiveMQ Cloud Webinar
HiveMQ
 
How to Monitor and Observe IoT and MQTT Applications with HiveMQ
How to Monitor and Observe IoT and MQTT Applications with HiveMQ How to Monitor and Observe IoT and MQTT Applications with HiveMQ
How to Monitor and Observe IoT and MQTT Applications with HiveMQ
HiveMQ
 
Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...
Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...
Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...
Dominik Obermaier
 
HiveMQ Cloud - The Cloud Native IoT Messaging Layer
HiveMQ Cloud - The Cloud Native IoT Messaging LayerHiveMQ Cloud - The Cloud Native IoT Messaging Layer
HiveMQ Cloud - The Cloud Native IoT Messaging Layer
Dominik Obermaier
 
Introducing HiveMQ Cloud
Introducing HiveMQ CloudIntroducing HiveMQ Cloud
Introducing HiveMQ Cloud
MargarethaErber
 
Io t meetup-detroit-mqtt-5
Io t meetup-detroit-mqtt-5Io t meetup-detroit-mqtt-5
Io t meetup-detroit-mqtt-5
Florian Raschbichler
 
Kafka Summit 2021 - Why MQTT and Kafka are a match made in heaven
Kafka Summit 2021 - Why MQTT and Kafka are a match made in heavenKafka Summit 2021 - Why MQTT and Kafka are a match made in heaven
Kafka Summit 2021 - Why MQTT and Kafka are a match made in heaven
Dominik Obermaier
 
Modernizing the Manufacturing Industry with Kafka and MQTT
Modernizing the Manufacturing Industry with Kafka and MQTT Modernizing the Manufacturing Industry with Kafka and MQTT
Modernizing the Manufacturing Industry with Kafka and MQTT
Dominik Obermaier
 
IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...
IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...
IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...
HostedbyConfluent
 
How to Stream IoT MQTT Messages Into the Azure Event Hubs Service
How to Stream IoT MQTT Messages Into the Azure Event Hubs ServiceHow to Stream IoT MQTT Messages Into the Azure Event Hubs Service
How to Stream IoT MQTT Messages Into the Azure Event Hubs Service
HiveMQ
 
IoT Meetup HiveMQ and MQTT
IoT Meetup HiveMQ and MQTTIoT Meetup HiveMQ and MQTT
IoT Meetup HiveMQ and MQTT
Ian Skerrett
 
Introduction MQTT in English
Introduction MQTT in EnglishIntroduction MQTT in English
Introduction MQTT in English
Eric Xiao
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
Ranjan Baisak
 
Intro to Microservices Architecture
Intro to Microservices ArchitectureIntro to Microservices Architecture
Intro to Microservices Architecture
Peter Nijem
 

Similar to Building Scalable & Reliable MQTT Clients for Enterprise Computing (20)

HiveMQ + Kafka: The ideal solution for IoT MQTT data integration
HiveMQ + Kafka: The ideal solution for IoT MQTT data integrationHiveMQ + Kafka: The ideal solution for IoT MQTT data integration
HiveMQ + Kafka: The ideal solution for IoT MQTT data integration
 
MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT
MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT
MQTT AS A KEY TECHNOLOGY FOR INDUSTRY 4.0 & IIoT
 
HiveMQ + Kafka - The Ideal Solution for IoT MQTT Data Integration
HiveMQ + Kafka - The Ideal Solution for IoT MQTT Data IntegrationHiveMQ + Kafka - The Ideal Solution for IoT MQTT Data Integration
HiveMQ + Kafka - The Ideal Solution for IoT MQTT Data Integration
 
How mqtt 5 makes difficult io t use cases possible
How mqtt 5 makes difficult io t use cases possibleHow mqtt 5 makes difficult io t use cases possible
How mqtt 5 makes difficult io t use cases possible
 
Machine to Machine Communication with Microsoft Azure IoT Edge & HiveMQ
Machine to Machine Communication with Microsoft Azure IoT Edge & HiveMQMachine to Machine Communication with Microsoft Azure IoT Edge & HiveMQ
Machine to Machine Communication with Microsoft Azure IoT Edge & HiveMQ
 
How MQTT 5 Makes Difficult IoT Use Cases Possible
How MQTT 5 Makes Difficult IoT Use Cases PossibleHow MQTT 5 Makes Difficult IoT Use Cases Possible
How MQTT 5 Makes Difficult IoT Use Cases Possible
 
HiveMQ Cloud Webinar
HiveMQ Cloud WebinarHiveMQ Cloud Webinar
HiveMQ Cloud Webinar
 
How to Monitor and Observe IoT and MQTT Applications with HiveMQ
How to Monitor and Observe IoT and MQTT Applications with HiveMQ How to Monitor and Observe IoT and MQTT Applications with HiveMQ
How to Monitor and Observe IoT and MQTT Applications with HiveMQ
 
Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...
Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...
Software-Infrastrukturen modernisieren in der Produktion - Digitale Transform...
 
HiveMQ Cloud - The Cloud Native IoT Messaging Layer
HiveMQ Cloud - The Cloud Native IoT Messaging LayerHiveMQ Cloud - The Cloud Native IoT Messaging Layer
HiveMQ Cloud - The Cloud Native IoT Messaging Layer
 
Introducing HiveMQ Cloud
Introducing HiveMQ CloudIntroducing HiveMQ Cloud
Introducing HiveMQ Cloud
 
Io t meetup-detroit-mqtt-5
Io t meetup-detroit-mqtt-5Io t meetup-detroit-mqtt-5
Io t meetup-detroit-mqtt-5
 
Kafka Summit 2021 - Why MQTT and Kafka are a match made in heaven
Kafka Summit 2021 - Why MQTT and Kafka are a match made in heavenKafka Summit 2021 - Why MQTT and Kafka are a match made in heaven
Kafka Summit 2021 - Why MQTT and Kafka are a match made in heaven
 
Modernizing the Manufacturing Industry with Kafka and MQTT
Modernizing the Manufacturing Industry with Kafka and MQTT Modernizing the Manufacturing Industry with Kafka and MQTT
Modernizing the Manufacturing Industry with Kafka and MQTT
 
IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...
IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...
IoT Data Streaming - Why MQTT and Kafka are a match made in heaven | Dominik ...
 
How to Stream IoT MQTT Messages Into the Azure Event Hubs Service
How to Stream IoT MQTT Messages Into the Azure Event Hubs ServiceHow to Stream IoT MQTT Messages Into the Azure Event Hubs Service
How to Stream IoT MQTT Messages Into the Azure Event Hubs Service
 
IoT Meetup HiveMQ and MQTT
IoT Meetup HiveMQ and MQTTIoT Meetup HiveMQ and MQTT
IoT Meetup HiveMQ and MQTT
 
Introduction MQTT in English
Introduction MQTT in EnglishIntroduction MQTT in English
Introduction MQTT in English
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
Intro to Microservices Architecture
Intro to Microservices ArchitectureIntro to Microservices Architecture
Intro to Microservices Architecture
 

More from HiveMQ

IoT Security Issues and MQTT
IoT Security Issues and MQTTIoT Security Issues and MQTT
IoT Security Issues and MQTT
HiveMQ
 
Testing the Scalability of a Robust IoT System with Confidence
Testing the Scalability of a Robust IoT System with ConfidenceTesting the Scalability of a Robust IoT System with Confidence
Testing the Scalability of a Robust IoT System with Confidence
HiveMQ
 
Designing an Edge to Cloud Architecture for IIoT
Designing an Edge to Cloud Architecture for IIoTDesigning an Edge to Cloud Architecture for IIoT
Designing an Edge to Cloud Architecture for IIoT
HiveMQ
 
MQTT.fx on HiveMQ Cloud Testing MQTT in the Cloud
MQTT.fx on HiveMQ Cloud Testing MQTT in the CloudMQTT.fx on HiveMQ Cloud Testing MQTT in the Cloud
MQTT.fx on HiveMQ Cloud Testing MQTT in the Cloud
HiveMQ
 
What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]
What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]
What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]
HiveMQ
 
HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...
HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...
HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...
HiveMQ
 
Connecting the Smart Factory to the Cloud
Connecting the Smart Factory to the CloudConnecting the Smart Factory to the Cloud
Connecting the Smart Factory to the Cloud
HiveMQ
 
Revolutionizing IoT Testing - A Sneak Peek of HiveMQ Swarm
Revolutionizing IoT Testing - A Sneak Peek of HiveMQ SwarmRevolutionizing IoT Testing - A Sneak Peek of HiveMQ Swarm
Revolutionizing IoT Testing - A Sneak Peek of HiveMQ Swarm
HiveMQ
 
Debugging MQTT Client Communications With MQTT.fx and HiveMQ Cloud
Debugging MQTT Client Communications With MQTT.fx and HiveMQ CloudDebugging MQTT Client Communications With MQTT.fx and HiveMQ Cloud
Debugging MQTT Client Communications With MQTT.fx and HiveMQ Cloud
HiveMQ
 
Introduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoT
Introduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoTIntroduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoT
Introduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoT
HiveMQ
 
Free Your Manufacturing Data with Apache PLC4X & MQTT
Free Your Manufacturing Data with Apache PLC4X & MQTTFree Your Manufacturing Data with Apache PLC4X & MQTT
Free Your Manufacturing Data with Apache PLC4X & MQTT
HiveMQ
 
Build Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionBuild Your Own HiveMQ Extension
Build Your Own HiveMQ Extension
HiveMQ
 
How to Set up, Run and Scale a Secure MQTT Broker on Kubernetes
How to Set up, Run and Scale a Secure MQTT Broker on KubernetesHow to Set up, Run and Scale a Secure MQTT Broker on Kubernetes
How to Set up, Run and Scale a Secure MQTT Broker on Kubernetes
HiveMQ
 
MQTT - The Key to Scalable Reliable Connected Car Platforms
MQTT - The Key to Scalable Reliable Connected Car PlatformsMQTT - The Key to Scalable Reliable Connected Car Platforms
MQTT - The Key to Scalable Reliable Connected Car Platforms
HiveMQ
 
Modernizing the Manufacturing Industry with MQTT and Kafka
Modernizing the Manufacturing Industry with MQTT and KafkaModernizing the Manufacturing Industry with MQTT and Kafka
Modernizing the Manufacturing Industry with MQTT and Kafka
HiveMQ
 
Simplified IoT Operations With HiveMQ and Datadog
Simplified IoT Operations With HiveMQ and DatadogSimplified IoT Operations With HiveMQ and Datadog
Simplified IoT Operations With HiveMQ and Datadog
HiveMQ
 
Implementing the 5 Pillars of IT Security for MQTT
Implementing the 5 Pillars of IT Security for MQTTImplementing the 5 Pillars of IT Security for MQTT
Implementing the 5 Pillars of IT Security for MQTT
HiveMQ
 
4 Paradigm Shifts for the Connected Car of the Future
4 Paradigm Shifts for the Connected Car of the Future4 Paradigm Shifts for the Connected Car of the Future
4 Paradigm Shifts for the Connected Car of the Future
HiveMQ
 

More from HiveMQ (18)

IoT Security Issues and MQTT
IoT Security Issues and MQTTIoT Security Issues and MQTT
IoT Security Issues and MQTT
 
Testing the Scalability of a Robust IoT System with Confidence
Testing the Scalability of a Robust IoT System with ConfidenceTesting the Scalability of a Robust IoT System with Confidence
Testing the Scalability of a Robust IoT System with Confidence
 
Designing an Edge to Cloud Architecture for IIoT
Designing an Edge to Cloud Architecture for IIoTDesigning an Edge to Cloud Architecture for IIoT
Designing an Edge to Cloud Architecture for IIoT
 
MQTT.fx on HiveMQ Cloud Testing MQTT in the Cloud
MQTT.fx on HiveMQ Cloud Testing MQTT in the CloudMQTT.fx on HiveMQ Cloud Testing MQTT in the Cloud
MQTT.fx on HiveMQ Cloud Testing MQTT in the Cloud
 
What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]
What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]
What's New in HiveMQ [Inside the Upcoming HiveMQ 4.7 Release]
 
HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...
HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...
HiveMQ & HighByte Presents: Building an Enterprise Unified Namespace (UNS) to...
 
Connecting the Smart Factory to the Cloud
Connecting the Smart Factory to the CloudConnecting the Smart Factory to the Cloud
Connecting the Smart Factory to the Cloud
 
Revolutionizing IoT Testing - A Sneak Peek of HiveMQ Swarm
Revolutionizing IoT Testing - A Sneak Peek of HiveMQ SwarmRevolutionizing IoT Testing - A Sneak Peek of HiveMQ Swarm
Revolutionizing IoT Testing - A Sneak Peek of HiveMQ Swarm
 
Debugging MQTT Client Communications With MQTT.fx and HiveMQ Cloud
Debugging MQTT Client Communications With MQTT.fx and HiveMQ CloudDebugging MQTT Client Communications With MQTT.fx and HiveMQ Cloud
Debugging MQTT Client Communications With MQTT.fx and HiveMQ Cloud
 
Introduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoT
Introduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoTIntroduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoT
Introduction to MQTT Sparkplug: Plug 'n Play Interoperability for IIoT
 
Free Your Manufacturing Data with Apache PLC4X & MQTT
Free Your Manufacturing Data with Apache PLC4X & MQTTFree Your Manufacturing Data with Apache PLC4X & MQTT
Free Your Manufacturing Data with Apache PLC4X & MQTT
 
Build Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionBuild Your Own HiveMQ Extension
Build Your Own HiveMQ Extension
 
How to Set up, Run and Scale a Secure MQTT Broker on Kubernetes
How to Set up, Run and Scale a Secure MQTT Broker on KubernetesHow to Set up, Run and Scale a Secure MQTT Broker on Kubernetes
How to Set up, Run and Scale a Secure MQTT Broker on Kubernetes
 
MQTT - The Key to Scalable Reliable Connected Car Platforms
MQTT - The Key to Scalable Reliable Connected Car PlatformsMQTT - The Key to Scalable Reliable Connected Car Platforms
MQTT - The Key to Scalable Reliable Connected Car Platforms
 
Modernizing the Manufacturing Industry with MQTT and Kafka
Modernizing the Manufacturing Industry with MQTT and KafkaModernizing the Manufacturing Industry with MQTT and Kafka
Modernizing the Manufacturing Industry with MQTT and Kafka
 
Simplified IoT Operations With HiveMQ and Datadog
Simplified IoT Operations With HiveMQ and DatadogSimplified IoT Operations With HiveMQ and Datadog
Simplified IoT Operations With HiveMQ and Datadog
 
Implementing the 5 Pillars of IT Security for MQTT
Implementing the 5 Pillars of IT Security for MQTTImplementing the 5 Pillars of IT Security for MQTT
Implementing the 5 Pillars of IT Security for MQTT
 
4 Paradigm Shifts for the Connected Car of the Future
4 Paradigm Shifts for the Connected Car of the Future4 Paradigm Shifts for the Connected Car of the Future
4 Paradigm Shifts for the Connected Car of the Future
 

Recently uploaded

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 

Recently uploaded (20)

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 

Building Scalable & Reliable MQTT Clients for Enterprise Computing

  • 1. Copyright © by HiveMQ. All Rights Reserved.
  • 2. Copyright © by HiveMQ. All Rights Reserved. WELCOME Silvio Giebl Clive Jevons • Software Developer @HiveMQ • Developer and Maintainer of the HiveMQ MQTT Client • Distributed & scalable systems • High performance and reactive applications • Independent Consultant @Jevons IT • Used the HiveMQ MQTT Client to integrate it in a connected car platform • Was involved in the development of the HiveMQ MQTT Client
  • 3. Copyright © by HiveMQ. All Rights Reserved. What we will talk about ... • What is an MQTT client? → You will learn how flexible MQTT can be used for a variety of use cases • Why HiveMQ MQTT Client? → You will learn the features and the advantages • Real world Enterprise use case of the HiveMQ MQTT Client in a connected car platform → You will learn from the experience of an actual user
  • 4. Copyright © by HiveMQ. All Rights Reserved. What is MQTT?
  • 5. Copyright © by HiveMQ. All Rights Reserved. What is MQTT? • Communication protocol • Publish/Subscribe pattern • OASIS and ISO Standard (ISO/IEC PRF 20922) → interoperability • Decoupling of sender and receiver in space, in time → more robust and scalable • QoS levels → reliable communication over unreliable networks • Flexible, lightweight, dynamic topics, data agnostic • Use cases: IoT, IIoT, Industry 4.0, Logistics, Connected Cars, ... → everything that links a lot of devices
  • 6. Copyright © by HiveMQ. All Rights Reserved. What is MQTT 5? • A lot of additional features while keeping MQTT lightweight and flexible • Many improvements making MQTT an even more versatile protocol
  • 7. Copyright © by HiveMQ. All Rights Reserved. What is an MQTT Client?
  • 8. Copyright © by HiveMQ. All Rights Reserved. What is an MQTT Client? • MQTT is known to be used for small devices • Actually it is used for a variety of systems • MQTT is lightweight and does not put restrictions on applications → Almost everything can be an MQTT client • Embedded: sensors, control units, ... • Mobile/desktop: apps, browser applications, ... • Backend: integration with other systems, databases, microservices, ... • Different use cases, different requirements • But all have in common that they need to communicate in a reliable way
  • 9. Copyright © by HiveMQ. All Rights Reserved. MQTT Clients for Embedded Requirements • Low computing power • Low bandwidth • High latency • Unstable network • Huge amount of devices, little data per device → All covered by MQTT • MQTT clients are lightweight • Minimal network overhead • QoS guarantees • MQTT Broker removes complexity from clients, ensures scalability
  • 10. Copyright © by HiveMQ. All Rights Reserved. MQTT Clients for Mobile Requirements • Platform independent • Responsiveness, reactiveness • Unstable network → All covered by MQTT • MQTT is a wire protocol standard, so interoperable • MQTT is push based • QoS guarantees
  • 11. Copyright © by HiveMQ. All Rights Reserved. MQTT Clients for Backends • Usually MQTT is used for a huge amount of clients, each handling a small portion of the data • Backend systems are often used for ingestion of all data for monitoring, analytics and control Requirements • Scalability • High throughput per service • Reliability, no message loss, no overload, backpressure → All covered by MQTT • Scalability is ensured by the broker • Shared subscriptions for scaling out/load balancing MQTT clients
  • 12. Copyright © by HiveMQ. All Rights Reserved. MQTT Clients for Backends • Shared subscriptions are especially useful for microservice like systems • Subscribers can join/leave the shared subscription group dynamically • Shared subscriptions are standardized with MQTT 5 (they can be supported for MQTT 3 as well)
  • 13. Copyright © by HiveMQ. All Rights Reserved. HiveMQ MQTT Client
  • 14. Copyright © by HiveMQ. All Rights Reserved. HiveMQ MQTT Client • MQTT Client Java Library • All MQTT 3.1.1 and MQTT 5 features (including all optional features) • Open Source • Different API flavors: Reactive, Asynchronous, Blocking Key Benefits • Reactive • Backpressure, Stability, Reliability • Resource efficiency, low overhead, high throughput
  • 15. Copyright © by HiveMQ. All Rights Reserved. MQTT Features • MQTT 3 and 5: all QoS levels, retained messages, Will/LWT, ... • MQTT 5 • Session expiry • Message expiry • Flow Control → better backpressure handling • Shared subscriptions (also supported for MQTT 3) • Payload Format Indicator and Content Type • User properties • Negative acknowledgements and reason strings • Request/Response • Topic Aliases (automatically) • Subscription Identifiers (automatically) • Enhanced Auth
  • 16. Copyright © by HiveMQ. All Rights Reserved. Features on top of MQTT • TLS/SSL • Websocket, Secure Websocket • Automatic reconnect (automatic & configurable) • Offline message buffering • Thread management (automatic & configurable) • Thread safety • Pluggable Enhanced Auth support • Automatic topic alias tracing and mapping • Backpressure handling (deep integration with the reactive API)
  • 17. Copyright © by HiveMQ. All Rights Reserved. Open Source • Source code on GitHub: https://github.com/hivemq/hivemq-mqtt-client • Apache 2 license • Free to use • Actively maintained by HiveMQ • Transparent development • Issues and PRs on GitHub • Feedback and contributions are welcome • Why Open Source? • MQTT is the standard IoT protocol • Everybody should be able to use MQTT
  • 18. Copyright © by HiveMQ. All Rights Reserved. Example Uses MQTT CLI • Command Line Tool • Debugging • Simulating MQTT Clients Internal: HiveMQ Device Simulator • Simulating millions of MQTT clients with few machines • Used to reproduce customer scenarios • Used as a benchmark tool
  • 19. Copyright © by HiveMQ. All Rights Reserved. Why Different API Flavors? • Enables fast prototyping • All APIs are as simple as possible • But starting with the blocking API is often simpler • Only a few lines of code for MQTT communication • Allows evolution of applications • Asynchronous API is often enough • Parts can be switched to reactive when scaling and more precise backpressure control is needed • Different API styles can be used simultaneously • Fluent Builders also help • Only use the features you need • When you need more features, no need to rewrite your whole code
  • 20. Copyright © by HiveMQ. All Rights Reserved. What Does Lightweight Mean? • Communication should not use a major part of the computing time • Low memory usage → around 5KB per client instance • Many clients possible • Intelligent thread pooling • Overhead per client is minimal • Also possible to use 1 client by many threads → flexibility • Recommendation: if different parts of a service are independent, use more clients instead of sharing 1 client to avoid unnecessary coupling • Application messages and computations are important
  • 21. Copyright © by HiveMQ. All Rights Reserved. Embedded, Mobile, Backend • Resource efficiency helps all use cases • Embedded/mobile → hardware/battery restrictions • Backend → enables higher throughput for actual processing • Backend: • Scaling with shared subscriptions • Backpressure helps building more robust systems • Mobile: Support for Android • API 19/KitKat and up → > 96% • Reactive API • Mobile: responsiveness, often used on Android • Backend: resilience https://developer.android.com/about/dashboards
  • 22. Copyright © by HiveMQ. All Rights Reserved. Why Reactive? • Reactive Manifesto (https://www.reactivemanifesto.org/): • Responsive • Resilient • Elastic • Message driven • Reactive is the solution for high scale applications • Perfect fit for MQTT
  • 23. Copyright © by HiveMQ. All Rights Reserved. Why Reactive? • HiveMQ MQTT Client is reactive • In its core • Has a reactive API using RxJava which follows the reactive streams specification • Interoperable with other reactive libraries (interoperability is not only important for the MQTT protocol, but also the libraries) • Barrier of entry: • You have to learn new concepts, think differently • Good news: you can start with the asynchronous API and move to reactive later
  • 24. Copyright © by HiveMQ. All Rights Reserved. What is Backpressure? • Mechanism to adapt message rates in an asynchronous system • If an application is overwhelmed by too many messages • It might crash • It might drop important messages (without other applications/the broker even knowing) • A lot of unnecessary work is done when dropping messages • Backpressure lets the application that produces too many messages know, that they can not be handled → appropriate and early actions can be taken • When using shared subscriptions the load can be better balanced between all clients in the group • → Backpressure improves resilience and robustness • MQTT 5 Flow Control limits concurrent unacknowledged messages
  • 25. Copyright © by HiveMQ. All Rights Reserved. API Design "APIs should be easy to use and hard to misuse. It should be easy to do simple things; possible to do complex things; and impossible, or at least difficult, to do wrong things." (Joshua Bloch) • The HiveMQ MQTT Client gives you full control over all MQTT features • It is not a restrictive framework • But using sensible defaults, you do not have to configure everything • The context sensitive fluent builder pattern used throughout the library enables short concise code but highly customizable
  • 26. Copyright © by HiveMQ. All Rights Reserved. Code examples
  • 27. Copyright © by HiveMQ. All Rights Reserved. Setup dependencies { implementation group: 'com.hivemq', name: 'hivemq-mqtt-client', version: '1.1.3' } <dependencies> <dependency> <groupId>com.hivemq</groupId> <artifactId>hivemq-mqtt-client</artifactId> <version>1.1.3</version> </dependency> </dependencies> Maven Central, JCenter, JitPack
  • 28. Copyright © by HiveMQ. All Rights Reserved. Client configuration Mqtt5Client client1 = Mqtt5Client.builder().build(); Mqtt5Client client2 = Mqtt5Client.builder() .identifier("client2") .serverHost("broker.hivemq.com") .serverPort(1234) .sslWithDefaultConfig() .webSocketWithDefaultConfig() .automaticReconnectWithDefaultConfig() .addConnectedListener(context -> System.out.println("connected")) .addDisconnectedListener(context -> System.out.println("disconnected")) .build();
  • 29. Copyright © by HiveMQ. All Rights Reserved. Client configuration Mqtt5Client client3 = Mqtt5Client.builder() .identifier("client3") .transportConfig() .serverHost("broker.hivemq.com") .serverPort(1234) .sslConfig() .protocols(Arrays.asList("TLSv1.3")) .cipherSuites(Arrays.asList("TLS_AES_128_GCM_SHA256")) .trustManagerFactory(myTrustManager) .keyManagerFactory(myKeyManager) .applySslConfig() .webSocketConfig() .serverPath("mqtt") .subprotocol("mqtt") .applyWebSocketConfig() .applyTransportConfig() ...
  • 30. Copyright © by HiveMQ. All Rights Reserved. Client configuration ... .automaticReconnect() .initialDelay(100, TimeUnit.MILLISECONDS) .maxDelay(10, TimeUnit.SECONDS) .applyAutomaticReconnect() .addDisconnectedListener(context -> { context.getReconnector().reconnectWhen( getOAuthToken(), (token, throwable) -> { ((Mqtt5ClientDisconnectedContext) context).getReconnector() .connectWith() .simpleAuth().password(token).applySimpleAuth() .applyConnect(); }); }) ...
  • 31. Copyright © by HiveMQ. All Rights Reserved. Client configuration ... .simpleAuth() .username("username") .password("password".getBytes()) .applySimpleAuth() .willPublish() .topic("will") .qos(MqttQos.AT_LEAST_ONCE) .payload("hello world".getBytes()) .messageExpiryInterval(10) .payloadFormatIndicator(Mqtt5PayloadFormatIndicator.UTF_8) .contentType("text/plain") .userProperties() .add("time", System.currentTimeMillis() + "ms") .add("sender", "client3") .applyUserProperties() .applyWillPublish() .build();
  • 32. Copyright © by HiveMQ. All Rights Reserved. Simple Publish & Subscribe client.connect(); client.publishWith() .topic("demo/topic") .qos(MqttQos.EXACTLY_ONCE) .payload("hello world".getBytes()) .send(); client.disconnect(); client.connect(); client.toAsync().subscribeWith() .topicFilter("demo/#") .callback(System.out::println) .send(); client.disconnect();
  • 33. Copyright © by HiveMQ. All Rights Reserved. Async Publish Mqtt5AsyncClient async = client.toAsync(); async.connect() .thenCompose(connAck -> async.publishWith() .topic("demo/topic") .qos(MqttQos.EXACTLY_ONCE) .send()) .thenCompose(publishResult -> async.disconnect());
  • 34. Copyright © by HiveMQ. All Rights Reserved. MQTT 5 Features client.connectWith() .cleanStart(false) // resume a previous session .sessionExpiryInterval(30) // keep session state for 30s .restrictions() .receiveMaximum(10) // receive max. 10 concurrent messages .sendMaximum(10) // send max. 10 concurrent messages .maximumPacketSize(10_240) // receive messages with max size of 10KB .sendMaximumPacketSize(10_240) // send messages with max size of 10KB .topicAliasMaximum(0) // the server should not use topic aliases .sendTopicAliasMaximum(8) // use up to 8 aliases for the most used topics .applyRestrictions() .send();
  • 35. Copyright © by HiveMQ. All Rights Reserved. MQTT 5 Features client.publishWith() .topic("demo/topic") .qos(MqttQos.EXACTLY_ONCE) .payload("hello world".getBytes()) .retain(true) .payloadFormatIndicator(Mqtt5PayloadFormatIndicator.UTF_8) .contentType("text/plain") // our payload is text .messageExpiryInterval(120) // not so important, expire after 2min if can not be delivered .responseTopic("demo/response") .correlationData("1234".getBytes()) .userProperties() // add some user properties to the message .add("sender", "client1") .add("receiver", "you") .applyUserProperties() .send();
  • 36. Copyright © by HiveMQ. All Rights Reserved. Reactive Request/Response Flowable<Mqtt5Publish> requestStream = client.toRx() .subscribeStreamWith() .topicFilter("request/topic") .applySubscribe(); Flowable<Mqtt5PublishResult> responseStream = client.toRx() .publish(requestStream .filter(requestPublish -> checkIfResponsible(requestPublish)) .observeOn(Schedulers.computation()) .map(requestPublish -> Mqtt5Publish.builder() .topic(requestPublish.getResponseTopic().get()) .qos(requestPublish.getQos()) .payload(performComputation(requestPublish.getPayload())) .correlationData(requestPublish.getCorrelationData().orElse(null)) .build())); responseStream.subscribe();
  • 37. Copyright © by HiveMQ. All Rights Reserved. Reactive Android Example client1.toRx() .subscribeStreamWith() .topicFilter("chat1/messages/#") .applySubscribe() .observeOn(AndroidSchedulers.mainThread()) .doOnNext(message -> addMessageToUi(message)) .observeOn(AndroidSchedulers.from(backgroundLooper)) .filter(message -> isImportant(message)) .doOnNext(message -> createNotification(message)) .subscribe();
  • 38. Copyright © by HiveMQ. All Rights Reserved. Use of MQTT Clients in a Connected Car Platform
  • 39. Copyright © by HiveMQ. All Rights Reserved. Use Cases 1) Mirroring fleet data between clusters 2) Integrating HiveMQ Client into communication middleware joynr 3) Using HiveMQ Client for processing data from a production plant
  • 40. Copyright © by HiveMQ. All Rights Reserved. Resources MQTT Essentials Series Evaluate HiveMQ Broker Try HiveMQ Cloud for Free Get Started with MQTT MQTT at OASIS
  • 41. ANY QUESTIONS? Reach out to community.hivemq.com
  • 42. THANK YOU Stay updated on upcoming webinars Subscribe to our Newsletter!