dotnetcore / CAP

Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
http://cap.dotnetcore.xyz
MIT License
6.61k stars 1.28k forks source link

Nats improvement 1545 #1556

Closed davidterins closed 2 months ago

davidterins commented 2 months ago

Description:

With these changes a consumer of the DotNetCore.CAP.NATS nuget package can opt out from allowing a NATS Consumer client to create topics and streams dynamically which enforces each client to be granted "admin" like permissions. To avoid assigning these permissions to each client, a consumer of the nuget package can now opt out from this by specifying NATSOptions property EnableSubscriberClientStreamAndSubjectCreation to false (defaults to true).

Issue(s) addressed:

Changes:

Affected components:

How to test:

  1. Start a nats server (with no configured streams)
  2. Start application with a cap subscriber on a specific subject/topic Configured with NatsOptions EnableSubscriberClientStreamAndSubjectCreation: false
  3. The client will fail to subscribe since the expected stream does not yet exist.
  4. Configure the nats server with expected streams and topics expected by application in step 2
  5. The application should subscribe to the now configured streams and topics.

Checklist:

Reviewers: