Class SubscriberReady
java.lang.Object
org.apache.sling.distribution.journal.impl.subscriber.SubscriberReady
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IdleCheck
A DistributionSubscriber is considered ready when one of the conditions is met:
- is idle (no further message received) for more than the idleMillis at least once
- is busy processing the same package for more than MAX_RETRIES times. (blocked queue assumed)
- received message created time is less than 120 seconds
- DEFAULT_FORCE_IDLE_MILLIS time has passed
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionSubscriberReady
(String subAgentName, long idleMillis, long forceIdleMillies, AtomicBoolean readyHolder, Supplier<Long> timeProvider) -
Method Summary
-
Field Details
-
ACCEPTABLE_AGE_DIFF_MS
public static final long ACCEPTABLE_AGE_DIFF_MS -
MAX_RETRIES
public static final int MAX_RETRIES- See Also:
-
-
Constructor Details
-
SubscriberReady
public SubscriberReady(String subAgentName, long idleMillis, long forceIdleMillies, AtomicBoolean readyHolder, Supplier<Long> timeProvider)
-
-
Method Details
-
isReady
public boolean isReady() -
busy
public void busy(int retries, long messageCreateTime) Called when processing of a message starts -
idle
public void idle()Called when processing of a message has finished -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-