Class SubscriberIdle

  • All Implemented Interfaces:
    Closeable, AutoCloseable, IdleCheck

    public class SubscriberIdle
    extends Object
    implements IdleCheck
    A DistributionSubscriber is considered ready when it is idle for more than the READY_IDLE_TIME_SECONDS at least once ; or when it is busy processing the same package for more than MAX_RETRIES times.
    • Constructor Detail

      • SubscriberIdle

        public SubscriberIdle​(int idleMillis,
                              int forceIdleMillies,
                              AtomicBoolean readyHolder)
    • Method Detail

      • isIdle

        public boolean isIdle()
        Specified by:
        isIdle in interface IdleCheck
      • busy

        public void busy​(int retries)
        Called when processing of a message starts
        Specified by:
        busy in interface IdleCheck
        Parameters:
        retries - the number of retries to process the message
      • idle

        public void idle()
        Called when processing of a message has finished
        Specified by:
        idle in interface IdleCheck