Skip to content

fix(events/natsjs): default to auto ack#165

Open
grechny wants to merge 1 commit into
go-micro:mainfrom
grechny:fix/natsjs-default-auto-ack
Open

fix(events/natsjs): default to auto ack#165
grechny wants to merge 1 commit into
go-micro:mainfrom
grechny:fix/natsjs-default-auto-ack

Conversation

@grechny

@grechny grechny commented Jul 15, 2026

Copy link
Copy Markdown

Description

Default NATS JetStream event consumers to automatic acknowledgement, matching
the documented events.ConsumeOptions contract and the NATS Streaming and
in-memory event implementations.

Without this initialization, the AutoAck zero value creates an
AckExplicit durable consumer. Callers relying on the documented default then
accumulate pending messages and redeliveries under load.

The regression test inspects the JetStream consumer configuration and covers
both the default and the explicit manual-ack override.

Fixes #164

Testing

cd v4/events/natsjs
go test ./...

Result:

ok  github.com/go-micro/plugins/v4/events/natsjs

Checklist

  • Default consumption uses automatic acknowledgement.
  • Explicit manual acknowledgement remains supported.
  • Regression test runs against an embedded JetStream server.

Match the documented events contract and other stream implementations.

Fixes go-micro#164

Signed-off-by: Aliaksandr Hrechny <8013455+grechny@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(events/natsjs): default AutoAck does not match events contract

1 participant