From 9bc34aa03bb98a1ae7d94b0eab7893c415410ebc Mon Sep 17 00:00:00 2001 From: Vadim Tkachenko Date: Mon, 9 Oct 2023 01:10:47 -0700 Subject: [PATCH] More diagnostics (#271, #290) --- .../net/sf/dz3r/device/mqtt/v1/AbstractMqttAdapter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dz3r-mqtt/src/main/java/net/sf/dz3r/device/mqtt/v1/AbstractMqttAdapter.java b/dz3r-mqtt/src/main/java/net/sf/dz3r/device/mqtt/v1/AbstractMqttAdapter.java index bc76b6ba9..26d63b227 100644 --- a/dz3r-mqtt/src/main/java/net/sf/dz3r/device/mqtt/v1/AbstractMqttAdapter.java +++ b/dz3r-mqtt/src/main/java/net/sf/dz3r/device/mqtt/v1/AbstractMqttAdapter.java @@ -212,7 +212,12 @@ private Flux createFlux(String topic, boolean includeSubtopics) { }); }); - var result = flux.publish().autoConnect(); + var result = flux + .doOnNext(s -> logger.trace("{}: receive: {}", getAddress(), s)) + .doOnError(t -> logger.error("{}: errored out", getAddress(), t)) + .doOnComplete(() -> logger.debug("{}: completed", getAddress())) + .publish() + .autoConnect(); var topicFilter = topic + (includeSubtopics ? "/#" : "");