Package org.acemq.amqp.api
Class PublishFailedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.acemq.amqp.api.AceMqException
org.acemq.amqp.api.PublishFailedException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionPublishFailedException(String message) PublishFailedException(String message, boolean unroutable) PublishFailedException(String message, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the broker took the message and returned it as unroutable.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
PublishFailedException
-
PublishFailedException
-
PublishFailedException
- Parameters:
message- what happenedunroutable-truewhen 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.falsefor abasic.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:
truewhen nothing was bound to receive the message
-