@@ -22,51 +22,50 @@ Wether you chose [compose](./docker/compose) or [helm](./k8s/helm), the `setup.s
22
22
23
23
### Using this example
24
24
25
- Using eclipse-mosquitto subscribe to the sensors/# topic.
25
+ Using eclipse-mosquitto subscribe to the ` smartylighting/streetlights/1/0/event/+/lighting/measured ` topic.
26
26
27
27
``` bash
28
- mosquitto_sub -V ' 5' -t ' sensors/# ' -d -p 7183
28
+ mosquitto_sub -V ' 5' -t ' smartylighting/streetlights/1/0/event/+/lighting/measured ' -d -p 7183
29
29
```
30
30
31
31
output:
32
32
33
33
```
34
34
Client null sending CONNECT
35
- Client 7f37e11e-8f79-458a-a4b3-3ffb36a9e08b received CONNACK (0)
36
- Client 7f37e11e-8f79-458a-a4b3-3ffb36a9e08b sending SUBSCRIBE (Mid: 1, Topic: sensors/# , QoS: 0, Options: 0x00)
37
- Client 7f37e11e-8f79-458a-a4b3-3ffb36a9e08b received SUBACK
35
+ Client 26c02b9a-0e29-44c6-9f0e-277655c8d712 received CONNACK (0)
36
+ Client 26c02b9a-0e29-44c6-9f0e-277655c8d712 sending SUBSCRIBE (Mid: 1, Topic: smartylighting/streetlights/1/0/event/+/lighting/measured , QoS: 0, Options: 0x00)
37
+ Client 26c02b9a-0e29-44c6-9f0e-277655c8d712 received SUBACK
38
38
Subscribed (mid: 1): 0
39
- Client 7f37e11e-8f79-458a-a4b3-3ffb36a9e08b received PUBLISH (d0, q0, r0, m0, 'sensors/1 ', ... (24 bytes))
40
- {"id":"1","status ":"on "}
39
+ Client 26c02b9a-0e29-44c6-9f0e-277655c8d712 received PUBLISH (d0, q0, r0, m0, 'smartylighting/streetlights/1/0/event/5/lighting/measured ', ... (49 bytes))
40
+ {"lumens":50,"sentAt ":"2024-06-07T12:34:32.000Z "}
41
41
```
42
42
43
- In a separate session, publish a valid message on the sensors/1 topic.
43
+ In a separate session, publish a valid message on the ` smartylighting/streetlights/1/0/event/1/lighting/measured ` topic.
44
44
45
45
``` bash
46
- mosquitto_pub -V ' 5' -t ' sensors/1 ' -m ' {"id":"1","status ":"on "}' -d -p 7183
46
+ mosquitto_pub -V ' 5' -t ' smartylighting/streetlights/1/0/event/1/lighting/measured ' -m ' {"lumens":50,"sentAt ":"2024-06-07T12:34:32.000Z "}' -d -p 7183
47
47
```
48
48
49
49
output:
50
50
51
51
```
52
52
Client null sending CONNECT
53
- Client 2fc05cdc-5e1d-4e00-be18-0026ae47e749 received CONNACK (0)
54
- Client 2fc05cdc-5e1d-4e00-be18-0026ae47e749 sending PUBLISH (d0, q0, r0, m1, 'sensors/1 ', ... (24 bytes))
55
- Client 2fc05cdc-5e1d-4e00-be18-0026ae47e749 sending DISCONNECT
53
+ Client a1f4ad8c-c9e8-4671-ad46-69030d4f1c9a received CONNACK (0)
54
+ Client a1f4ad8c-c9e8-4671-ad46-69030d4f1c9a sending PUBLISH (d0, q0, r0, m1, 'smartylighting/streetlights/1/0/event/1/lighting/measured ', ... (49 bytes))
55
+ Client a1f4ad8c-c9e8-4671-ad46-69030d4f1c9a sending DISCONNECT
56
56
```
57
57
58
- Now attempt to publish an invalid message, with property ` stat ` instead of ` status ` .
58
+ Now attempt to publish an invalid message by setting ` lumens ` property to a negative value .
59
59
60
60
``` bash
61
- mosquitto_pub -V ' 5' -t ' sensors/1 ' -m ' {"id":"1","stat ":"off "}' -d -p 7183 --repeat 2 --repeat-delay 3
61
+ mosquitto_pub -V ' 5' -t ' smartylighting/streetlights/1/0/event/1/lighting/measured ' -m ' {"lumens":-1,"sentAt ":"2024-06-07T12:34:32.000Z "}' -d -p 7183 --repeat 2 --repeat-delay 3
62
62
```
63
63
64
64
output:
65
-
66
65
```
67
66
Client null sending CONNECT
68
- Client cd166c27-de75-4a2e-b3c7-f16631bda2a9 received CONNACK (0)
69
- Client cd166c27-de75-4a2e-b3c7-f16631bda2a9 sending PUBLISH (d0, q0, r0, m1, 'sensors/1 ', ... (23 bytes))
67
+ Client 30157eed-0ea7-42c6-91e8-466d1dd0ab66 received CONNACK (0)
68
+ Client 30157eed-0ea7-42c6-91e8-466d1dd0ab66 sending PUBLISH (d0, q0, r0, m1, 'smartylighting/streetlights/1/0/event/1/lighting/measured ', ... (49 bytes))
70
69
Received DISCONNECT (153)
71
70
Error: The client is not currently connected.
72
71
```
0 commit comments