Skip to content
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

Support dynamic publishers #1010

Merged
merged 23 commits into from
May 19, 2022

Conversation

gkinsman
Copy link
Contributor

@gkinsman gkinsman commented May 13, 2022

This PR adds a new mechanism to support publishing to tenanted topics using the solution outlined in #1004.

It adds a new TopicPublicationBuilder<T> WithTopicName(Func<Message, string> topicNameCustomizer) overload to TopicPublicationBuilder<T> that allows users to dynamically create a topic at publish time instead of statically defining them on startup.

@gkinsman gkinsman requested a review from a team as a code owner May 13, 2022 09:26
@gkinsman gkinsman requested a review from slang25 May 13, 2022 09:26
@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #1010 (4d8e554) into main (db12efc) will increase coverage by 0.01%.
The diff coverage is 93.20%.

@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
+ Coverage   84.91%   84.92%   +0.01%     
==========================================
  Files         132      135       +3     
  Lines        3228     3290      +62     
==========================================
+ Hits         2741     2794      +53     
- Misses        487      496       +9     
Flag Coverage Δ
linux 84.92% <93.20%> (+0.01%) ⬆️
macos 51.75% <0.97%> (-1.03%) ⬇️
windows 51.75% <0.97%> (-1.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ng/Fluent/PublishConfig/DynamicMessagePublisher.cs 85.29% <85.29%> (ø)
...nt/PublishConfig/StaticPublicationConfiguration.cs 95.23% <95.23%> (ø)
...t/PublishConfig/DynamicPublicationConfiguration.cs 100.00% <100.00%> (ø)
...rc/JustSaying/Fluent/QueueSubscriptionBuilder`1.cs 88.33% <100.00%> (ø)
src/JustSaying/Fluent/TopicPublicationBuilder`1.cs 83.72% <100.00%> (-2.22%) ⬇️
...rc/JustSaying/Fluent/TopicSubscriptionBuilder`1.cs 86.56% <100.00%> (ø)
...ssageSerialization/MessageSerializationRegister.cs 96.15% <100.00%> (ø)
...ng/Middleware/ExactlyOnce/ExactlyOnceMiddleware.cs 77.77% <0.00%> (-14.82%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db12efc...4d8e554. Read the comment docs.

@gkinsman gkinsman force-pushed the support-dynamic-publishers branch from ebf9d5b to 20f9ce6 Compare May 18, 2022 09:26
src/JustSaying/Fluent/TopicPublicationBuilder`1.cs Outdated Show resolved Hide resolved
src/JustSaying/Fluent/TopicPublicationBuilder`1.cs Outdated Show resolved Hide resolved
src/JustSaying/Fluent/TopicPublicationBuilder`1.cs Outdated Show resolved Hide resolved
src/JustSaying/Fluent/TopicPublicationBuilder`1.cs Outdated Show resolved Hide resolved
src/JustSaying/Fluent/TopicPublicationBuilder`1.cs Outdated Show resolved Hide resolved
George Kinsman and others added 21 commits May 19, 2022 13:08
…artup and late-bound topic publishers.

- Make test pass (it fails sometimes for some reason still but let's agree on the shape)
- ConfigureAwait
…ublishes)

- Add unique test id to each queue so tests are independent
- Switch publisher cache to use concurrent dictionary to protect against reads if a publisher is being added by another thread.
- Add xml docs for new API
- Minor renames
- Publish second message to same topic to make sure that works
- Add some more docs
@gkinsman gkinsman force-pushed the support-dynamic-publishers branch from f81ee99 to b302636 Compare May 19, 2022 12:08
@martincostello martincostello added this to the v7.0.0 milestone May 19, 2022
@gkinsman gkinsman merged commit 002db5b into justeattakeaway:main May 19, 2022
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.

2 participants