aws / aws/aws-dotnet-messaging

Feature Request: Per-poller PollingControlToken (optional, opt-in)

Open
#345 0 comments 0 reactions 0 assignees View on GitHub
feature-request p2
Dominant language
C#
Stars
143
Forks
27
Avg merge
1d 18h
Merged PRs (30d)
4

Description

### Describe the feature

Allow `PollingControlToken` to be configured **per SQS poller** in addition to the existing bus-scoped token. The per-poller value is optional; when null, the poller falls back to the bus-scoped token set via `ConfigurePollingControlToken` (today's behavior, preserved).

### Use case

A single service consumes multiple SQS queues on one bus and needs to pause/resume them independently. Concrete example: a worker that backs up its primary work queue while a one-shot bootstrap queue must keep draining. With the current bus-scoped token, `Stop`/`Start` flip every poller on the bus together; there is no way to pause only one.

### Proposed solution

Add an optional `PollingControlToken` property to `SQSMessagePollerOptions`:

```csharp
bus.AddSQSPoller(queueUrl, opts =>
{
opts.PollingControlToken = pollerSpecificToken; // null = inherit bus-scoped token
opts.MaxNumberOfConcurrentMessages = 1;
});
```

### Other information

- Existing bus-scoped behavior unchanged; the new property defaults to null.
- Extends the pause/resume API delivered for #147 / PR #179 to multi-queue services.

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS.Messaging (or related) package versions

`AWS.Messaging` 1.3.0

### Targeted .NET Platform

net8.0, net10.0

### Operating System and version

N/A

Contributor guide

Open the contributing guide

Research direction

Start at SQSMessagePollerOptions and the AddSQSPoller entry point, then trace ConfigurePollingControlToken to understand how the existing bus-scoped token reaches each poller. Implement the optional per-poller value with null fallback and verify that independent pause/resume works while existing bus-scoped behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.