}).publishReleaseHandler(messageId -> { endpoint.publishComplete(messageId); });
/** * Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL * message is received by the remote MQTT client * @param handler the handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.mqtt.MqttEndpoint publishReleaseHandler(Handler<Integer> handler) { delegate.publishReleaseHandler(handler); return this; }
/** * Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL * message is received by the remote MQTT client * @param handler the handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.mqtt.MqttEndpoint publishReleaseHandler(Handler<Integer> handler) { delegate.publishReleaseHandler(handler); return this; }
/** * Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL * message is received by the remote MQTT client * @param handler the handler * @return a reference to this, so the API can be used fluently */ public MqttEndpoint publishReleaseHandler(Handler<Integer> handler) { delegate.publishReleaseHandler(handler); return this; }
/** * Setup handlers for MQTT endpoint */ private void setupMqttEndpoint() { this.mqttEndpoint .publishHandler(this::publishHandler) .publishAcknowledgeHandler(this::pubackHandler) .publishReleaseHandler(this::pubrelHandler) .publishReceivedHandler(this::pubrecHandler) .publishCompletionHandler(this::pubcompHandler) .subscribeHandler(this::subscribeHandler) .unsubscribeHandler(this::unsubscribeHandler) .disconnectHandler(this::disconnectHandler) .closeHandler(this::closeHandler); }
@Override protected void endpointHandler(MqttEndpoint endpoint, TestContext context) { endpoint.publishHandler(message -> { log.info("Just received message on [" + message.topicName() + "] payload [" + message.payload().toString(Charset.defaultCharset()) + "] with QoS [" + message.qosLevel() + "]"); switch (message.qosLevel()) { case AT_LEAST_ONCE: endpoint.publishAcknowledge(message.messageId()); this.async.complete(); break; case EXACTLY_ONCE: endpoint.publishReceived(message.messageId()); break; case AT_MOST_ONCE: this.async.complete(); break; } }).publishReleaseHandler(messageId -> { endpoint.publishComplete(messageId); this.async.complete(); }); endpoint.accept(false); }
@Override protected void endpointHandler(MqttEndpoint endpoint, TestContext context) { endpoint.publishHandler(message -> { log.info("Just received message on [" + message.topicName() + "] payload [" + message.payload().toString(Charset.defaultCharset()) + "] with QoS [" + message.qosLevel() + "]"); switch (message.qosLevel()) { case AT_LEAST_ONCE: endpoint.publishAcknowledge(message.messageId()); this.async.complete(); break; case EXACTLY_ONCE: endpoint.publishReceived(message.messageId()); break; case AT_MOST_ONCE: this.async.complete(); break; } }).publishReleaseHandler(messageId -> { endpoint.publishComplete(messageId); this.async.complete(); }); endpoint.accept(false); }
}).publishReleaseHandler(messageId -> {
}).publishReleaseHandler(messageId -> {
}).publishReleaseHandler(messageId -> {
}).publishReleaseHandler(messageId -> {
mqttEndpoint.publishReleaseHandler(pr -> { log.info("[SERVER] Receive PUBREL with message id = " + pr);
mqttEndpoint.publishReleaseHandler(pr -> { log.info("[SERVER] Receive PUBREL with message id = " + pr);