Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class RetryPolicy

  1. Object
  2. RetryPolicy

How often a failed message is delivered again, and how long apart.

SettingDefault
cn1.messaging.retry.max-attempts3deliveries before the dead-letter destination
cn1.messaging.retry.backoff1000milliseconds before the second delivery
cn1.messaging.retry.multiplier2how much longer each wait is than the last
cn1.messaging.retry.max-backoff30000the longest wait

Constructors

public RetryPolicy(int maxAttempts, long backoffMillis, int multiplier, long maxBackoffMillis)A policy of maxAttempts deliveries, waiting backoffMillis and then multiplier times longer each time, up to maxBackoffMillis.

Methods

public static RetryPolicy of(Config config) throws IOExceptionThe policy config describes.
public int getMaxAttempts()Deliveries before a message is dead-lettered.
public long delayAfter(int attempt)Milliseconds to wait before delivery attempt + 1, after delivery attempt failed.
public static String deadLetter(String destination)The dead-letter destination of destination.

Inherited methods

Constructor details

RetryPolicy

public RetryPolicy(int maxAttempts, long backoffMillis, int multiplier, long maxBackoffMillis)
A policy of maxAttempts deliveries, waiting backoffMillis and then multiplier times longer each time, up to maxBackoffMillis.

Method details

of

public static RetryPolicy of(Config config) throws IOException
The policy config describes.

getMaxAttempts

public int getMaxAttempts()
Deliveries before a message is dead-lettered.

delayAfter

public long delayAfter(int attempt)
Milliseconds to wait before delivery attempt + 1, after delivery attempt failed.

deadLetter

public static String deadLetter(String destination)
The dead-letter destination of destination.