Class MqttEndpoint
- java.lang.Object
-
- io.vertx.mutiny.mqtt.MqttEndpoint
-
public class MqttEndpoint extends Object
Represents an MQTT endpoint for point-to-point communication with the remote MQTT client NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MqttEndpoint>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description MqttEndpoint(io.vertx.mqtt.MqttEndpoint delegate)
MqttEndpoint(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MqttEndpoint
accept()
MqttEndpoint
accept(boolean sessionPresent)
MqttEndpoint
accept(boolean sessionPresent, io.netty.handler.codec.mqtt.MqttProperties properties)
io.vertx.mqtt.MqttAuth
auth()
MqttEndpoint
autoKeepAlive(boolean isAutoKeepAlive)
String
clientIdentifier()
void
close()
MqttEndpoint
closeHandler(Runnable handler)
io.netty.handler.codec.mqtt.MqttProperties
connectProperties()
MqttEndpoint
disconnect(io.vertx.mqtt.messages.codes.MqttDisconnectReasonCode code, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
disconnectHandler(Runnable handler)
MqttEndpoint
disconnectMessageHandler(Consumer<MqttDisconnectMessage> handler)
boolean
equals(Object o)
MqttEndpoint
exceptionHandler(Consumer<Throwable> handler)
io.vertx.mqtt.MqttEndpoint
getDelegate()
int
hashCode()
MultiMap
httpHeaders()
String
httpRequestURI()
boolean
isAutoKeepAlive()
boolean
isCleanSession()
boolean
isConnected()
boolean
isPublishAutoAck()
boolean
isSsl()
boolean
isSubscriptionAutoAck()
int
keepAliveTimeSeconds()
int
lastMessageId()
SocketAddress
localAddress()
static MqttEndpoint
newInstance(io.vertx.mqtt.MqttEndpoint arg)
MqttEndpoint
pingHandler(Runnable handler)
MqttEndpoint
pong()
String
protocolName()
int
protocolVersion()
io.smallrye.mutiny.Uni<Integer>
publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
Sends the PUBLISH message to the remote MQTT serverio.smallrye.mutiny.Uni<Integer>
publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId)
Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdio.smallrye.mutiny.Uni<Integer>
publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties)
Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdMqttEndpoint
publishAcknowledge(int publishMessageId)
MqttEndpoint
publishAcknowledge(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubAckReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
publishAcknowledgeHandler(Consumer<Integer> handler)
MqttEndpoint
publishAcknowledgeMessageHandler(Consumer<MqttPubAckMessage> handler)
Integer
publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
.Integer
publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId)
Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
.Integer
publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
that ignores the result of the operation.MqttEndpoint
publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId)
Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
that ignores the result of the operation.MqttEndpoint
publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties)
Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
that ignores the result of the operation.MqttEndpoint
publishAutoAck(boolean isPublishAutoAck)
MqttEndpoint
publishComplete(int publishMessageId)
MqttEndpoint
publishComplete(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubCompReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
publishCompletionHandler(Consumer<Integer> handler)
MqttEndpoint
publishCompletionMessageHandler(Consumer<MqttPubCompMessage> handler)
MqttEndpoint
publishHandler(Consumer<MqttPublishMessage> handler)
MqttEndpoint
publishReceived(int publishMessageId)
MqttEndpoint
publishReceived(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRecReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
publishReceivedHandler(Consumer<Integer> handler)
MqttEndpoint
publishReceivedMessageHandler(Consumer<MqttPubRecMessage> handler)
MqttEndpoint
publishRelease(int publishMessageId)
MqttEndpoint
publishRelease(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRelReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
publishReleaseHandler(Consumer<Integer> handler)
MqttEndpoint
publishReleaseMessageHandler(Consumer<MqttPubRelMessage> handler)
MqttEndpoint
reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode)
MqttEndpoint
reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode, io.netty.handler.codec.mqtt.MqttProperties properties)
SocketAddress
remoteAddress()
MqttEndpoint
setClientIdentifier(String clientIdentifier)
MqttEndpoint
subscribeAcknowledge(int subscribeMessageId, List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels)
MqttEndpoint
subscribeAcknowledge(int subscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttSubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
subscribeHandler(Consumer<MqttSubscribeMessage> handler)
void
subscriptionAutoAck(boolean isSubscriptionAutoAck)
String
toString()
MqttEndpoint
unsubscribeAcknowledge(int unsubscribeMessageId)
MqttEndpoint
unsubscribeAcknowledge(int unsubscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttUnsubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties)
MqttEndpoint
unsubscribeHandler(Consumer<MqttUnsubscribeMessage> handler)
io.vertx.mqtt.MqttWill
will()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MqttEndpoint> __TYPE_ARG
-
-
Constructor Detail
-
MqttEndpoint
public MqttEndpoint(io.vertx.mqtt.MqttEndpoint delegate)
-
MqttEndpoint
public MqttEndpoint(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.mqtt.MqttEndpoint getDelegate()
-
close
public void close()
-
remoteAddress
public SocketAddress remoteAddress()
- Returns:
- the remote address for this socket
-
localAddress
public SocketAddress localAddress()
- Returns:
- the local address for this socket
-
isSsl
public boolean isSsl()
- Returns:
- true if this
MqttEndpoint
is encrypted via SSL/TLS.
-
httpHeaders
public MultiMap httpHeaders()
- Returns:
- the HTTP headers
-
httpRequestURI
public String httpRequestURI()
- Returns:
- the HTTP request uri
-
clientIdentifier
public String clientIdentifier()
- Returns:
- the client identifier as provided by the remote MQTT client
-
auth
public io.vertx.mqtt.MqttAuth auth()
- Returns:
- the Authentication information as provided by the remote MQTT client
-
will
public io.vertx.mqtt.MqttWill will()
- Returns:
- the Will information as provided by the remote MQTT client
-
protocolVersion
public int protocolVersion()
- Returns:
- the protocol version required by the remote MQTT client
-
protocolName
public String protocolName()
- Returns:
- the protocol name provided by the remote MQTT client
-
isCleanSession
public boolean isCleanSession()
- Returns:
- true when clean session is requested by the remote MQTT client
-
keepAliveTimeSeconds
public int keepAliveTimeSeconds()
- Returns:
- the keep alive timeout (in seconds) specified by the remote MQTT client
-
lastMessageId
public int lastMessageId()
- Returns:
- the message identifier used for last published message
-
subscriptionAutoAck
public void subscriptionAutoAck(boolean isSubscriptionAutoAck)
- Parameters:
isSubscriptionAutoAck
- auto acknowledge status
-
isSubscriptionAutoAck
public boolean isSubscriptionAutoAck()
- Returns:
- true when auto acknowledge status for subscription/unsubscription requests
-
publishAutoAck
public MqttEndpoint publishAutoAck(boolean isPublishAutoAck)
- Parameters:
isPublishAutoAck
- auto acknowledge status- Returns:
- a reference to this, so the API can be used fluently
-
isPublishAutoAck
public boolean isPublishAutoAck()
- Returns:
- auto acknowledge status for publishing (in/out)
-
autoKeepAlive
public MqttEndpoint autoKeepAlive(boolean isAutoKeepAlive)
- Parameters:
isAutoKeepAlive
- auto keep alive- Returns:
- a reference to this, so the API can be used fluently
-
isAutoKeepAlive
public boolean isAutoKeepAlive()
- Returns:
- the auto keep alive status (sending ping response)
-
isConnected
public boolean isConnected()
- Returns:
- if the connection between remote client and local endpoint is established/open
-
setClientIdentifier
public MqttEndpoint setClientIdentifier(String clientIdentifier)
- Parameters:
clientIdentifier
- the client identifier- Returns:
- a reference to this, so the API can be used fluently
-
disconnectHandler
public MqttEndpoint disconnectHandler(Runnable handler)
- Parameters:
handler
- the handler- Returns:
-
disconnectMessageHandler
public MqttEndpoint disconnectMessageHandler(Consumer<MqttDisconnectMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
subscribeHandler
public MqttEndpoint subscribeHandler(Consumer<MqttSubscribeMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
unsubscribeHandler
public MqttEndpoint unsubscribeHandler(Consumer<MqttUnsubscribeMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
publishHandler
public MqttEndpoint publishHandler(Consumer<MqttPublishMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
publishAcknowledgeHandler
public MqttEndpoint publishAcknowledgeHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
publishAcknowledgeMessageHandler
public MqttEndpoint publishAcknowledgeMessageHandler(Consumer<MqttPubAckMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
publishReceivedHandler
public MqttEndpoint publishReceivedHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
publishReceivedMessageHandler
public MqttEndpoint publishReceivedMessageHandler(Consumer<MqttPubRecMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
publishReleaseHandler
public MqttEndpoint publishReleaseHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
publishReleaseMessageHandler
public MqttEndpoint publishReleaseMessageHandler(Consumer<MqttPubRelMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
publishCompletionHandler
public MqttEndpoint publishCompletionHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
publishCompletionMessageHandler
public MqttEndpoint publishCompletionMessageHandler(Consumer<MqttPubCompMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
pingHandler
public MqttEndpoint pingHandler(Runnable handler)
- Parameters:
handler
- the handler- Returns:
-
closeHandler
public MqttEndpoint closeHandler(Runnable handler)
- Parameters:
handler
- the handler- Returns:
-
exceptionHandler
public MqttEndpoint exceptionHandler(Consumer<Throwable> handler)
- Parameters:
handler
- the handler- Returns:
-
accept
public MqttEndpoint accept()
- Returns:
- the instance of MqttEndpoint to chain method calls.
-
accept
public MqttEndpoint accept(boolean sessionPresent)
- Parameters:
sessionPresent
- if a previous session is present- Returns:
- a reference to this, so the API can be used fluently
-
reject
public MqttEndpoint reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode)
- Parameters:
returnCode
- the connect return code- Returns:
- a reference to this, so the API can be used fluently
-
subscribeAcknowledge
public MqttEndpoint subscribeAcknowledge(int subscribeMessageId, List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels)
- Parameters:
subscribeMessageId
- identifier of the SUBSCRIBE message to acknowledgegrantedQoSLevels
- granted QoS levels for the requested topics- Returns:
- a reference to this, so the API can be used fluently
-
unsubscribeAcknowledge
public MqttEndpoint unsubscribeAcknowledge(int unsubscribeMessageId)
- Parameters:
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishAcknowledge
public MqttEndpoint publishAcknowledge(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishReceived
public MqttEndpoint publishReceived(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishRelease
public MqttEndpoint publishRelease(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishComplete
public MqttEndpoint publishComplete(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publish
@CheckReturnValue public io.smallrye.mutiny.Uni<Integer> publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
Sends the PUBLISH message to the remote MQTT serverUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retained- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
publishAndAwait
public Integer publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retained- Returns:
- the Integer instance produced by the operation.
-
publishAndForget
public MqttEndpoint publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
that ignores the result of the operation.This method subscribes on the result of
publish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frompublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
but you don't need to compose it with other operations.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retained- Returns:
- the instance of MqttEndpoint to chain method calls.
-
publish
@CheckReturnValue public io.smallrye.mutiny.Uni<Integer> publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId)
Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedmessageId
- message ID- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
publishAndAwait
public Integer publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId)
Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedmessageId
- message ID- Returns:
- the Integer instance produced by the operation.
-
publishAndForget
public MqttEndpoint publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId)
Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
that ignores the result of the operation.This method subscribes on the result of
publish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frompublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
but you don't need to compose it with other operations.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedmessageId
- message ID- Returns:
- the instance of MqttEndpoint to chain method calls.
-
pong
public MqttEndpoint pong()
- Returns:
- a reference to this, so the API can be used fluently
-
connectProperties
public io.netty.handler.codec.mqtt.MqttProperties connectProperties()
- Returns:
- MQTT properties of the CONNECT message
-
accept
public MqttEndpoint accept(boolean sessionPresent, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
sessionPresent
- if a previous session is presentproperties
- CONNACK message properties (MQTT5)- Returns:
- a reference to this, so the API can be used fluently
-
reject
public MqttEndpoint reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
returnCode
- the connect return codeproperties
- CONNACK message properties- Returns:
- a reference to this, so the API can be used fluently
-
subscribeAcknowledge
public MqttEndpoint subscribeAcknowledge(int subscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttSubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
subscribeMessageId
- identifier of the SUBSCRIBE message to acknowledgereasonCodes
- reason codesproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
unsubscribeAcknowledge
public MqttEndpoint unsubscribeAcknowledge(int unsubscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttUnsubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledgereasonCodes
- reason codesproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
publishAcknowledge
public MqttEndpoint publishAcknowledge(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubAckReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
-
publishReceived
public MqttEndpoint publishReceived(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRecReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- code of the outcomeproperties
- MQTT properties- Returns:
- a reference to this, so the API can be used fluently
-
publishRelease
public MqttEndpoint publishRelease(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRelReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- reason codeproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
publishComplete
public MqttEndpoint publishComplete(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubCompReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- reason codeproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
publish
@CheckReturnValue public io.smallrye.mutiny.Uni<Integer> publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties)
Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedmessageId
- message IDproperties
- PUBLISH message properties- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
publishAndAwait
public Integer publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties)
Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedmessageId
- message IDproperties
- PUBLISH message properties- Returns:
- the Integer instance produced by the operation.
-
publishAndForget
public MqttEndpoint publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties)
Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
that ignores the result of the operation.This method subscribes on the result of
publish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frompublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
but you don't need to compose it with other operations.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedmessageId
- message IDproperties
- PUBLISH message properties- Returns:
- the instance of MqttEndpoint to chain method calls.
-
disconnect
public MqttEndpoint disconnect(io.vertx.mqtt.messages.codes.MqttDisconnectReasonCode code, io.netty.handler.codec.mqtt.MqttProperties properties)
- Parameters:
code
- reason codeproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
public static MqttEndpoint newInstance(io.vertx.mqtt.MqttEndpoint arg)
-
-