-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Publisher TopicAddress customizer #1625
base: main
Are you sure you want to change the base?
Add Publisher TopicAddress customizer #1625
Conversation
Updates the build script to enable local runs against localstack using either docker or podman as the container runner command
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1625 +/- ##
==========================================
- Coverage 78.56% 78.55% -0.01%
==========================================
Files 141 144 +3
Lines 3550 3638 +88
Branches 501 507 +6
==========================================
+ Hits 2789 2858 +69
- Misses 512 527 +15
- Partials 249 253 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
samples/src/JustSaying.Sample.Restaurant.OrderingApi/Program.cs
Outdated
Show resolved
Hide resolved
private readonly string _topicArnTemplate = topicArnTemplate; | ||
private readonly ConcurrentDictionary<string, IMessagePublisher> _publisherCache = new(); | ||
private readonly ConcurrentDictionary<string, IMessageBatchPublisher> _batchPublisherCache = new(); | ||
private readonly ConcurrentDictionary<string, SemaphoreSlim> _topicCreationLocks = new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we OK with these never being disposed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think given Publishers tend to last the lifetime of the application, it should be okay.
To make sure unmanaged resources get cleaned up, SemaphoreSlim also (transiently) uses a SafeHandle, which will also cleanup on finalize.
This PR adds the required APIs and internals for allowing a publisher to be configured that uses message content to determine the topic ARN to publish to.