Simple Outbox Handler
This class purpose is to create an easy way to create an outbox handler.
In order to achieve this, the following assumptions are made:
Object mapper is used for serializing and deserializing outbox (Before invoking handleWithParsedPayload the object mapper deserializer is invoked)
Linear retries are applied 1 minute from now (clock is used)
Note: This is a quick solution to avoid duplicate code. It should be extracted to support multiple retries policies and support configurable serialize.
Constructors
Types
Functions
Returns the next execution time for the outbox item.
Returns the amount of time that the outbox items of this handler's type should be retained. The outbox items will be deleted after this amount of time has passed after their completion.
Returns the type of the outbox item that this handler can handle.
Handles the outbox item when it has reached the maximum number of retries.
This method is invoked after the payload is deserialized. The payload is already of type T and can be cast to it. This method should be implemented by the user.
Returns true if the outbox item has reached the maximum number of retries.
Serializes the payload into a string.