Enum Class AckMode
- All Implemented Interfaces:
Serializable, Comparable<AckMode>, Constable
When a subscription makes a QoS 1 or QoS 2 delivery eligible for acknowledgement. QoS 0 deliveries need none.
PUBACK (QoS 1) or PUBREC (QoS 2) waits until every subscription that received the message
meets its condition. PUBACK and PUBREC follow one receive-order sequence. A delivery that has
not met its condition therefore holds back the acknowledgements of every later QoS 1 and
QoS 2 message on the connection, including other subscriptions' messages. PUBCOMP does not
wait for such a delivery.
Push subscriptions keep a delivery's capacity until its handler finishes and, for QoS 1 and
2, its acknowledgement has its turn. Pull subscriptions release it at handoff (ON_RECEIVE) or at
MqttDelivery.ack() (MANUAL), and hand-off subscriptions when their acceptor accepts the
delivery, in either mode. The client also limits the receptions that may await protocol
completion in one session, including QoS 2 exchanges and connections that continue the
session; ClientStats.Receiving.receptions() shows the limit. A QoS 1 or 2 message that
exhausts either bound ends the connection; see Subscribe.bufferCapacity().
Connection loss alone does not release a push delivery's capacity in a continued session.
Acknowledgement never releases a running handler's capacity.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAfter the handler returns normally.When the application callsMqttDelivery.ack().Immediately before invoking the handler, when a pull receive hands off the delivery, or when a hand-off subscription's acceptor accepts it. -
Method Summary
-
Enum Constant Details
-
ON_RECEIVE
Immediately before invoking the handler, when a pull receive hands off the delivery, or when a hand-off subscription's acceptor accepts it. The default for pull and hand-off subscriptions. Does not wait for application processing, and a handler failure does not withdraw it; seeFailurePolicy. -
AFTER_HANDLER
After the handler returns normally. The default for a subscription with a handler; rejected for pull and hand-off subscriptions. -
MANUAL
When the application callsMqttDelivery.ack(). Call it for every delivery; it has no effect where no acknowledgement is needed. A subscription that requested QoS 0 still receives QoS 1 or 2 messages that also match another subscription, soMqttMessage.qos()can exceedSubscription.grantedQos().
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-