MQTT and SensorThings API MQTT Extension sensorweb.geomatics.ucalgary.ca www.sensorup.com 0.23 litre/minute 0.25 litre/minute 0.27 litre/minute RH: 85 % Temp: 18 Celsius Dr. Steve Liang, Ph.D., P.Eng. Associate Professor, University of Calgary Founder and CEO, SensorUp Inc.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
MQTT and SensorThings API MQTT Extension
sensorweb.geomatics.ucalgary.cawww.sensorup.com
0.23 litre/minute
0.25 litre/minute0.27 litre/minuteRH: 85 %
Temp: 18 Celsius
Dr. Steve Liang, Ph.D., P.Eng. Associate Professor, University of Calgary Founder and CEO, SensorUp Inc.
MQTT Topics cont.๏plus sign (+) is the single level wild card
๏ e.g., a subscription of house/+/temperature will receive messages published to both house/living-room/temperature and house/bed-room/temperature
๏# is multi-level wildcard
๏ e.g., house/# is subscribing to all topics begins with house
MQTT wildcard
MQTT BrokerPublisher Subscribers
Subscribers
SubscribersInstead of client/server, MQTT has the
roles of publisher/subscriber subscribe to:
h/+/t
subscribe to: house/b/+
subscribe to: h/b/t
MQTT wildcard
MQTT BrokerPublisher Subscribers
Subscribers
SubscribersInstead of client/server, MQTT has the
roles of publisher/subscriber h/+/t
h/b/+
h/b/s
publish to topic: h/b/t
MQTT wildcard
MQTT BrokerPublisher Subscribers
Subscribers
SubscribersInstead of client/server, MQTT has the
roles of publisher/subscriber h/+/t
h/b/+
h/b/s
publish to topic: h/a/t
MQTT QoS๏QoS-0: fire-and-forget
๏QoS-1: deliver at least once
๏ the broker stores messages on disk and retries until clients have acknowledged their delivery. (Possibly with duplicates.)
๏QoS-2: deliver exact once
๏have a second acknowledgement round-trip, to ensure that non-idempotent messages can be delivered exactly once
MQTT Retain Flag
๏ Second, messages have a ‘retain’ flag, indicating that they should be stored for delivery to new subscribers. For topics that are infrequently updated, it’s often useful to give new subscribers the last-known message right away (with an indication that it isn’t fresh). Newer retained messages replace previously ones.