Class RetryPolicy
java.lang.Object
com.codename1.backend.messaging.RetryPolicy
How often a failed message is delivered again, and how long apart.
| Setting | Default | |
|---|---|---|
cn1.messaging.retry.max-attempts |
3 | deliveries before the dead-letter destination |
cn1.messaging.retry.backoff |
1000 | milliseconds before the second delivery |
cn1.messaging.retry.multiplier |
2 | how much longer each wait is than the last |
cn1.messaging.retry.max-backoff |
30000 | the longest wait |
-
Constructor Summary
ConstructorsConstructorDescriptionRetryPolicy(int maxAttempts, long backoffMillis, int multiplier, long maxBackoffMillis) A policy ofmaxAttemptsdeliveries, waitingbackoffMillisand thenmultipliertimes longer each time, up tomaxBackoffMillis. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdeadLetter(String destination) The dead-letter destination ofdestination.longdelayAfter(int attempt) Milliseconds to wait before deliveryattempt + 1, after deliveryattemptfailed.intDeliveries before a message is dead-lettered.static RetryPolicyThe policyconfigdescribes.
-
Constructor Details
-
RetryPolicy
public RetryPolicy(int maxAttempts, long backoffMillis, int multiplier, long maxBackoffMillis) A policy ofmaxAttemptsdeliveries, waitingbackoffMillisand thenmultipliertimes longer each time, up tomaxBackoffMillis.
-
-
Method Details
-
of
The policyconfigdescribes.- Throws:
IOException
-
getMaxAttempts
public int getMaxAttempts()Deliveries before a message is dead-lettered. -
delayAfter
public long delayAfter(int attempt) Milliseconds to wait before deliveryattempt + 1, after deliveryattemptfailed. -
deadLetter
-