endpoint.publishAcknowledge(message.messageId()); } else if (message.qosLevel() == MqttQoS.EXACTLY_ONCE) { endpoint.publishReceived(message.messageId());
/** * Sends the PUBREC 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 publishReceived(int publishMessageId) { delegate.publishReceived(publishMessageId); return this; }
/** * Sends the PUBREC 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 publishReceived(int publishMessageId) { delegate.publishReceived(publishMessageId); return this; }
/** * Sends the PUBREC 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 publishReceived(int publishMessageId) { delegate.publishReceived(publishMessageId); return this; }
} else { this.mqttEndpoint.publishReceived(mqttPacketId); LOG.info("PUBREC [{}] to MQTT client {}", mqttPacketId, this.mqttEndpoint.clientIdentifier());
mqttEndpoint.publishReceived(3); mqttEndpoint.publishReceived(2); mqttEndpoint.publishReceived(1);
mqttEndpoint.publishReceived(3); mqttEndpoint.publishReceived(2); mqttEndpoint.publishReceived(1);
@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.publishReceived(message.messageId()); break;
endpoint.publishReceived(message.messageId()); break;
endpoint.publishReceived(message.messageId()); break;
endpoint.publishReceived(message.messageId()); break;