Slide 1

Slide 1 text

Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227 CSC 307 Introduction to Software Engineering Lecture 12. Message Queuing

Slide 2

Slide 2 text

Pong 2 https://github.com/CSC3100/Pong-Game

Slide 3

Slide 3 text

Message Queuing 3

Slide 4

Slide 4 text

MQTT Wh a t is MQTT? • MQTT (Mess a ge Queuing Telemetry Tr a nsport) is a lightweight, publish-subscribe network protocol. • Designed for constr a ined devices a nd low-b a ndwidth, high-l a tency, or unreli a ble networks. Key Fe a tures • Simple a nd e a sy to implement. • Low b a ndwidth consumption. • Reli a ble mess a ge delivery. • Sc a l a ble to millions of devices. 4

Slide 5

Slide 5 text

Eclipse Paho for Java Wh a t is Eclipse P a ho? • A set of MQTT client libr a ries developed by the Eclipse Found a tion. • It supports multiple l a ngu a ges, such a s J a v a , Python, J a v a Script, etc. J a v a Dependency (M a ven) org.eclipse.paho org.eclipse.paho.client.mqttv3 1.2.5 5

Slide 6

Slide 6 text

https://github.com/CSC3100/MQTT

Slide 7

Slide 7 text

Quality-of-service options • 0 – "at most once": A.K.A. "fire-and-forget." This option is suitable when message loss is acceptable, as it doesn't require acknowledgment or persistence. • 1 – "at least once": This option should be chosen when message loss is unacceptable, and your subscribers can handle duplicate messages. • 2 – "Exactly once": This option is ideal when message loss is unacceptable, and your subscribers cannot handle duplicate messages. 7

Slide 8

Slide 8 text

https://github.com/CSC3100/MQTT

Slide 9

Slide 9 text

Summary • MQTT: Lightweight, e ff i cient protocol for IoT and other use cases. • Mosquitto: A popular open-source MQTT broker. • Eclipse Paho: A versatile MQTT client library. • Java Example: https://github.com/CSC3100/MQTT 9

Slide 10

Slide 10 text

Idea 10

Slide 11

Slide 11 text

Questions 11

Slide 12

Slide 12 text

Lab

Slide 13

Slide 13 text

Challenge 13 * Could you create an MQTT version for the CLICK AND DRAW A DOT app? (yes, it is basically joining the two source codes) * Could it be possible to have it BI-DIRECTIONAL?

Slide 14

Slide 14 text

CSC 307 Introduction to Software Engineering Javier Gonzalez-Sanchez, Ph.D. [email protected] Summer 2024 Copyright. These slides can only be used as study material for the class CSC307 at Cal Poly. They cannot be distributed or used for another purpose.