Skip to content

Create Subscription Option for NATS #78

Description

@adeutscher

Below is Cursor's opinion on the viability of subscribing using NATS.

NATS JetStream. Today it uses FetchNoWaitAsync / NextAsync. NATS.Net’s ConsumeAsync is the documented long-running worker API: overlapping pull requests, per-message ack, MaxAckPending as prefetch. Protocol-wise it is still pull, but at the IJobSource layer it is the same structure (start a consumer, push into the intake queue, stop polling).

Testing

Similar to RabbitMQ, testing criteria is:

  • The implementation must be able to handle messages (spoiler alert)
  • In order for this effort to be worth merging into develop alongside the polling implementation, it should be immediately responsive to new messages
  • The implementation must be able to handle messages after a connection is lost/recovered. Restarting the message source should not be a process-breaker for the JobWorker.
  • The implementation should respect the JOBS__HALT_ON_FAILURE environment variable being set to true for major problems. Break the exception arbiter in a local test if you have to in order to confirm this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions