endpoint.publishComplete(messageId); }); })
/** * Sends the PUBCOMP message to the remote MQTT client * @param publishMessageId identifier of the PUBLISH message to acknowledge * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.mqtt.MqttEndpoint publishComplete(int publishMessageId) { delegate.publishComplete(publishMessageId); return this; }
/** * Sends the PUBCOMP message to the remote MQTT client * @param publishMessageId identifier of the PUBLISH message to acknowledge * @return a reference to this, so the API can be used fluently */ public MqttEndpoint publishComplete(int publishMessageId) { delegate.publishComplete(publishMessageId); return this; }
/** * Sends the PUBCOMP message to the remote MQTT client * @param publishMessageId identifier of the PUBLISH message to acknowledge * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.mqtt.MqttEndpoint publishComplete(int publishMessageId) { delegate.publishComplete(publishMessageId); return this; }
/** * Handler for incoming MQTT PUBREL message * * @param messageId message identifier */ private void pubrelHandler(int messageId) { LOG.info("PUBREL [{}] from MQTT client {}", messageId, this.mqttEndpoint.clientIdentifier()); // a PUBLISH message with QoS 2 was received from remote MQTT client, PUBREC was already sent // as reply, now that PUBREL is coming it's time to settle and reply with PUBCOMP this.pubEndpoint.settle(messageId); this.mqttEndpoint.publishComplete(messageId); LOG.info("PUBCOMP [{}] to MQTT client {}", messageId, this.mqttEndpoint.clientIdentifier()); }
mqttEndpoint.publishComplete(2); mqttEndpoint.publishComplete(1); mqttEndpoint.publishComplete(3);
mqttEndpoint.publishComplete(2); mqttEndpoint.publishComplete(1); mqttEndpoint.publishComplete(3);
endpoint.publishComplete(messageId); this.async.complete(); });
@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); }
endpoint.publishComplete(messageId); this.async.complete(); });
endpoint.publishComplete(messageId); this.async.complete(); });
endpoint.publishComplete(messageId); this.async.complete(); });