TemplateQueues messages to the primary outbox (WAL-based, guaranteed delivery)
Sends messages to the async outbox (polling-based, eventual delivery)
Starts consuming messages from PostgreSQL Logical Replication
Gets the consumer configuration parameters
Optional ReadonlyasyncOutbox?: UseAsyncOutboxPolicy<Message>Policy for configuring a separate async outbox consumer.
The async outbox is used for non-critical messages like compensations.
ReadonlyconsumerName: stringUnique name for this consumer instance.
Used to create a PostgreSQL replication slot.
ReadonlygetOptions: () => Options<Record<string, PostgresType>>Function that returns PostgreSQL connection options.
Optional Readonlynow?: NowFunctionFunction that returns the current date/time.
Optional ReadonlyonDbError?: ErrorCallbackCallback invoked when a database error occurs.
Optional ReadonlyonFailedPublish?: ErrorCallbackCallback invoked when message publishing fails.
Optional ReadonlypartitionKey?: stringPartition key for horizontal scaling.
Readonlypublish: (Callback invoked when Hermes delivers a message.
If this callback completes successfully, the message is acknowledged. If it throws an error, the message will be retried.
Optional ReadonlysaveTimestamps?: booleanWhether to save processing timestamps for each message.
⚠️ Use with caution: Significantly increases I/O operations.
Optional Readonlyserialization?: booleanWhether to process messages serially (one at a time) or concurrently.
Optional ReadonlyshouldDisposeOnSigterm?: booleanWhether to automatically stop the consumer on SIGTERM/SIGINT signals.
Optional ReadonlywaitAfterFailedPublish?: DurationDuration to wait after a failed publish attempt before retrying.
Gets the underlying PostgreSQL connection
Interface for the Outbox Consumer.
This is the main interface for interacting with Hermes PostgreSQL. It provides methods for starting the consumer, queueing messages, and accessing the database connection.
Message - The type of the domain message/event
Example
See
createOutboxConsumer for creating instances