fix subscribe
This commit is contained in:
@ -81,10 +81,9 @@ public class MqttReceiver {
|
|||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
client.connect(connOpts);
|
client.connect(connOpts);
|
||||||
for (String topic : parsers.keySet()) {
|
String[] topics = parsers.keySet().toArray(new String[0]);
|
||||||
client.subscribe(topic);
|
client.subscribe(topics);
|
||||||
logger.info("Re-Subscribed: " + topic);
|
logger.info("Re-Subscribed: " + topics.toString());
|
||||||
}
|
|
||||||
logger.error("reconnecting successfully completed");
|
logger.error("reconnecting successfully completed");
|
||||||
break;
|
break;
|
||||||
} catch (MqttException e) {
|
} catch (MqttException e) {
|
||||||
|
Reference in New Issue
Block a user