- java.lang.Object
-
- aeonics.entity.Discard
-
public class Discard extends java.lang.Object
This class is a specialized form ofOrigin
entity. It is used by the internal data processing mechanics as a last resort to process otherwise discarded messages.You do not have direct access to the entity, you should use the static methods available in this class instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Discard.Cause
The discard cause
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
drop(Message message, java.lang.String reason)
Handle an explicitly dropped message.static void
error(Message message, java.lang.Throwable cause)
Handle an error during processing.static void
expired(Message message)
Handle an expired message.static void
ignore(Message message, java.lang.String reason)
Handle an ignored message.static void
policy(Message message, java.lang.String reason)
Handle a policy restriction.static void
register()
-
-
-
Method Detail
-
register
public static void register()
-
expired
public static void expired(Message message)
Handle an expired message. An expired message can be because of a time validity or any other reason that make the message stale.- Parameters:
message
- the message
-
error
public static void error(Message message, java.lang.Throwable cause)
Handle an error during processing. A message can be in error because of a technical error (an exception), a business logic error (corrupted data), or any other dependency error (third party unavailable).- Parameters:
message
- the messagecause
- the error
-
ignore
public static void ignore(Message message, java.lang.String reason)
Handle an ignored message. A message is ignored when there is no handler or no binding to process it. It may also be a logical choice to ignore the message based on its content.- Parameters:
message
- the messagereason
- the reason
-
drop
public static void drop(Message message, java.lang.String reason)
Handle an explicitly dropped message. A message can be dropped explicitly for any reason. It could be because it is expired, ignored or else.- Parameters:
message
- the messagereason
- the reason
-
policy
public static void policy(Message message, java.lang.String reason)
Handle a policy restriction. A queue or other internal system that imposes restrictions (delay, rate, queue size) may reject a message that does not meet the policy settings.- Parameters:
message
- the messagereason
- the reason
-
-