Class MqttCapacityException

All Implemented Interfaces:
Serializable

public final class MqttCapacityException extends MqttException

A bounded resource has no available capacity.

As an operation's failure, this means the operation was not admitted; the rejection does not close an existing connection, and limit() names the limit that refused it. An observation that fails this way, such as one returned by Subscription.unsubscribe(), leaves the request it observes in place.

As a Disconnection.cause(), or the cause of MqttConnectException or MqttConnectionLostException, this means overload ended the affected connection, and limit() is empty; ClientStats.overloads() counts such endings by cause. Pending operations fail with that connection's termination.

See Also:
  • Constructor Details

    • MqttCapacityException

      public MqttCapacityException(String message)
      Describes an overload that ended a connection.
      Parameters:
      message - the detail message
    • MqttCapacityException

      public MqttCapacityException(String message, CapacityLimit limit)
      Describes an operation that limit refused.
      Parameters:
      message - the detail message
      limit - the limit that refused the operation
  • Method Details

    • limit

      public Optional<CapacityLimit> limit()
      Returns the limit that refused the operation, or empty when overload ended a connection.
      Returns:
      the limit that refused the operation, or empty when overload ended a connection