@@ -28,8 +28,9 @@ package main
28
28
29
29
import (
30
30
"fmt"
31
- MQTT "git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git"
32
31
"os"
32
+
33
+ MQTT "git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git"
33
34
)
34
35
35
36
var broker_load = make (chan bool )
@@ -68,21 +69,24 @@ func main() {
68
69
panic (err )
69
70
}
70
71
71
- if receipt , err := c .StartSubscription (brokerLoadHandler , "$SYS/broker/load/#" , MQTT .QOS_ZERO ); err != nil {
72
+ loadFilter , _ := MQTT .NewTopicFilter ("$SYS/broker/load/#" , 0 )
73
+ if receipt , err := c .StartSubscription (brokerLoadHandler , loadFilter ); err != nil {
72
74
fmt .Println (err )
73
75
os .Exit (1 )
74
76
} else {
75
77
<- receipt
76
78
}
77
79
78
- if receipt , err := c .StartSubscription (brokerConnectionHandler , "$SYS/broker/connection/#" , MQTT .QOS_ZERO ); err != nil {
80
+ connectionFilter , _ := MQTT .NewTopicFilter ("$SYS/broker/connection/#" , 0 )
81
+ if receipt , err := c .StartSubscription (brokerConnectionHandler , connectionFilter ); err != nil {
79
82
fmt .Println (err )
80
83
os .Exit (1 )
81
84
} else {
82
85
<- receipt
83
86
}
84
87
85
- if receipt , err := c .StartSubscription (brokerClientsHandler , "$SYS/broker/clients/#" , MQTT .QOS_ZERO ); err != nil {
88
+ clientsFilter , _ := MQTT .NewTopicFilter ("$SYS/broker/clients/#" , 0 )
89
+ if receipt , err := c .StartSubscription (brokerClientsHandler , clientsFilter ); err != nil {
86
90
fmt .Println (err )
87
91
os .Exit (1 )
88
92
} else {
0 commit comments