mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 21:31:53 +01:00
fix failing subscriptions (#1267)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
parent
218bb79dfd
commit
ea2ef7e25b
@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
|
||||
@NonNullByDefault
|
||||
public abstract class MqttAsyncClientWrapper {
|
||||
private final Logger logger = LoggerFactory.getLogger(MqttAsyncClientWrapper.class);
|
||||
private final Set<ClientCallback> subscriptions = ConcurrentHashMap.newKeySet();
|
||||
private final Set<String> subscriptions = ConcurrentHashMap.newKeySet();
|
||||
|
||||
/**
|
||||
* connect this client
|
||||
@ -72,7 +72,7 @@ public abstract class MqttAsyncClientWrapper {
|
||||
* @return a CompletableFuture (exceptionally on fail)
|
||||
*/
|
||||
public CompletableFuture<Boolean> subscribe(String topic, int qos, ClientCallback clientCallback) {
|
||||
boolean needsSubscription = subscriptions.add(clientCallback);
|
||||
boolean needsSubscription = subscriptions.add(topic);
|
||||
if (needsSubscription) {
|
||||
logger.trace("Trying to subscribe {} to topic {}", this, topic);
|
||||
return internalSubscribe(topic, qos, clientCallback).thenApply(s -> {
|
||||
|
Loading…
Reference in New Issue
Block a user