endpoint.publishAcknowledge(message.messageId()); } else if (message.qosLevel() == MqttQoS.EXACTLY_ONCE) { endpoint.publishReceived(message.messageId());
/** * Sends the PUBACK 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 publishAcknowledge(int publishMessageId) { delegate.publishAcknowledge(publishMessageId); return this; }
/** * Sends the PUBACK 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 publishAcknowledge(int publishMessageId) { delegate.publishAcknowledge(publishMessageId); return this; }
/** * Sends the PUBACK 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 publishAcknowledge(int publishMessageId) { delegate.publishAcknowledge(publishMessageId); return this; }
/** * Sends a PUBACK for the message to the device. */ public void acknowledge() { if (message != null && deviceEndpoint != null) { deviceEndpoint.publishAcknowledge(message.messageId()); } } }
this.mqttEndpoint.publishAcknowledge(mqttPacketId); LOG.info("PUBACK [{}] to MQTT client {}", mqttPacketId, this.mqttEndpoint.clientIdentifier()); } else {
ctx.deviceEndpoint().publishAcknowledge(ctx.message().messageId());
ctx.deviceEndpoint().publishAcknowledge(ctx.message().messageId());
mqttEndpoint.publishAcknowledge(2); mqttEndpoint.publishAcknowledge(1); mqttEndpoint.publishAcknowledge(3);
mqttEndpoint.publishAcknowledge(2); mqttEndpoint.publishAcknowledge(1); mqttEndpoint.publishAcknowledge(3);
ctx.deviceEndpoint().publishAcknowledge(ctx.message().messageId());
@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.publishAcknowledge(message.messageId()); this.async.complete(); break;
endpoint.publishAcknowledge(message.messageId()); this.async.complete(); break;
endpoint.publishAcknowledge(message.messageId()); this.async.complete(); break;
endpoint.publishAcknowledge(message.messageId()); this.async.complete(); break;