• Creates a logical replication service and keeps it running until stopped. Watches the table changes based on passed publication names and replication slot, handling messages based on the passed message handler. By default watches the "insert", "update", and "delete" operations.

    In case of errors, the service will try to recover for 20 attempts with an incremental delay between attempts for a total of ~5 minutes. Any success would reset the error attempts counter. Each failure will be logged with an attempts counter value. If 5 minutes passes without any errors - the errors counter is reset. If the counter increases over 20 in the span of 5 minutes - causing error will be thrown to crash the process to trigger a service reload that might resolve the issue.

    Parameters

    Returns Promise<(() => Promise<void>)>

    a function to stop the logical replication service.

Generated using TypeDoc