Class PublishFailedException

All Implemented Interfaces:
Serializable

public class PublishFailedException extends AceMqException
Raised when a publish did not result in a message the broker took responsibility for and could route.

Unroutable publishes raise this too. Silently dropping a message because no queue was bound is the failure mode this library exists to prevent, so it is an error unless the caller opts out.

See Also:
  • Constructor Details

    • PublishFailedException

      public PublishFailedException(String message)
    • PublishFailedException

      public PublishFailedException(String message, Throwable cause)
    • PublishFailedException

      public PublishFailedException(String message, boolean unroutable)
      Parameters:
      message - what happened
      unroutable - true when the broker returned the message because nothing was bound to receive it, rather than refusing or failing to confirm it
  • Method Details

    • isUnroutable

      public boolean isUnroutable()
      Whether the broker took the message and returned it as unroutable.

      false for a basic.nack, a publish that was never confirmed and one that could not be written: the broker would not keep the message, or it may not have reached it. The two need different fixes — a missing binding against a broker in trouble — so the difference is a field rather than wording to match.

      Returns:
      true when nothing was bound to receive the message