Hermes MySQL
    Preparing search index...

    Type Alias OutboxConsumer<Message>

    type OutboxConsumer<Message extends JSONValue> = {
        getDbConnection(): Pool;
        queue(
            message: MessageEnvelope<Message> | MessageEnvelope<Message>[],
            options?: PublishOptions,
        ): Promise<void>;
        start(): Promise<Stop>;
    }

    Type Parameters

    Index
    • Returns the pool that queue() uses without tx. It is created on the first call and stays open after stop(), so the application can keep using it; close it with end() when the application shuts down. Hermes polls with another pool.

      Returns Pool

    • Runs the migrations (unless migrate is false) and starts polling the outbox.

      Returns Promise<Stop>

      A function that stops polling, waits for the message being published, releases the claims and closes the pool that Hermes polls with. It does not close the pool of getDbConnection.