Class MqttPublicationRefusedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.mqtt4j.hato.MqttException
org.mqtt4j.hato.MqttPublicationRefusedException
- All Implemented Interfaces:
Serializable
The broker refused a publication, or would refuse it. A refusal arrives in PUBACK or PUBREC
with a reason code of 0x80 or greater, such as
ReasonCode.NOT_AUTHORIZED or
ReasonCode.QUOTA_EXCEEDED; the broker did not accept the message, and the exchange is over.
A publication that exceeds a limit that the broker announced for the connection is not sent
at all and fails with the reason code that the broker would use:
ReasonCode.QOS_NOT_SUPPORTED above ConnAck.maximumQos(),
ReasonCode.RETAIN_NOT_SUPPORTED without ConnAck.retainAvailable(), and
ReasonCode.PACKET_TOO_LARGE beyond ConnAck.maximumPacketSize(). A publication too large
for the client to send fails with ReasonCode.PACKET_TOO_LARGE in the same way, with any
broker. Either way the connection goes on. Only MQTT 5.0 brokers refuse publications or
announce these limits.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMqttPublicationRefusedException(ReasonCode reasonCode) A refusal without an explanation, such as the one that the client makes itself.MqttPublicationRefusedException(ReasonCode reasonCode, @Nullable String reasonString) A refusal with the broker's explanation, if the broker sent one. -
Method Summary
Modifier and TypeMethodDescriptionReturns the reason for the refusal, received in PUBACK or PUBREC, or the one that the broker would use for a publication that exceeds its announced limits.Returns the broker's explanation for people diagnosing the refusal, received in PUBACK or PUBREC, or empty when the broker sent none or the client refused without sending.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MqttPublicationRefusedException
A refusal without an explanation, such as the one that the client makes itself.- Parameters:
reasonCode- the reason for the refusal
-
MqttPublicationRefusedException
A refusal with the broker's explanation, if the broker sent one.- Parameters:
reasonCode- the reason for the refusalreasonString- the broker's explanation, or null when it sent none
-
-
Method Details
-
reasonCode
Returns the reason for the refusal, received in PUBACK or PUBREC, or the one that the broker would use for a publication that exceeds its announced limits.- Returns:
- the reason for the refusal, received in PUBACK or PUBREC, or the one that the broker would use for a publication that exceeds its announced limits
-
reasonString
Returns the broker's explanation for people diagnosing the refusal, received in PUBACK or PUBREC, or empty when the broker sent none or the client refused without sending.- Returns:
- the broker's explanation for people diagnosing the refusal, received in PUBACK or PUBREC, or empty when the broker sent none or the client refused without sending
-