AbstractThe definitions of the message that is handled.
The set of permissions that allow to execute the handler code
The configuration object
The authentication settings - AuthenticationConfig for customizable services and auth serice URL for managed services.
ReadonlyaggregateThe aggregate root type
ProtectedconfigProtected OptionalhandleProtectedloggerReadonlymessageThe name of the message created for the aggregate type.
ProtectedmessagingProtectedpermissionsThe set of permissions that allow to execute the handler code
ProtectedauthenticateIs called from the transactional inbox and calls the abstract
handleMessage function with the correct message payload typing. Do not
override this message but implement the handleMessage message.
The inbox message with the payload to handle.
The database client that is part of a DB env owner transaction to safely handle the inbox message.
Is called from the transactional inbox and calls the handleErrorMessage
function with the correct message payload typing. Do not override this
message but override the handleErrorMessage message.
The error that was thrown in the handle method.
The inbox message with the payload that was attempted to be handled.
The database client that is part of a (new) transaction to safely handle the error.
True if the message will be retried again.
A flag that defines if the message should be retried ('transient_error') or not ('permanent_error')
Optionally override this method with your custom business logic to handle
an error that was caused by the handleMessage method. The default
implementation logs the error if there are no further retries.
The error that was thrown in the handleMessage method.
The inbox message with the payload that was attempted to be handled.
True if the message will be retried again.
Optional_context: GuardedContextAbstracthandleImplement to execute your custom business logic to handle a message that was stored in the inbox.
The inbox message with the payload to handle.
The database client that is part of a DB env owner transaction to safely handle the inbox message.
Optionalcontext: GuardedContextFunction to map a thrown error of an unspecified type to a potentially more human-readable error or remove unsafe properties.
Protected AbstractsetAdd the PostgreSQL settings for the environment owner connection and subject
The env owner based DB client
The user or service account to use for setting the connection context
ProtectedupdateModifies the original error by extending its details subobject, if exists. Default behavior adds tenantId and environmentId to the details object by parsing the routing key. If still not available - returns original error. Some routing keys will not have tenantId and environmentId, e.g. when a command is sent. A separate handling is needed to extact these values, e.g. from the jwt.
Optionalcontext: GuardedContext
Create a new Message handler that provides both the functionality to store an incoming RabbitMQ message in the inbox and provides the actual logic to execute the business logic that is based on that message.