Module aeonics.core

Class Discard

    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 message
        cause - 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 message
        reason - 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 message
        reason - 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 message
        reason - the reason