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 SNS batch publishing #1335

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

martincostello
Copy link
Member

@martincostello martincostello commented Feb 1, 2024

Add support for batch publishing messages to SNS.

Supersedes #1098.

TODO

@martincostello martincostello added enhancement dependencies Pull requests that update a dependency file .NET Pull requests that update .net code labels Feb 1, 2024
@martincostello martincostello added this to the Future milestone Feb 1, 2024
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Attention: Patch coverage is 74.80916% with 99 lines in your changes are missing coverage. Please review.

Project coverage is 78.68%. Comparing base (7d0d73b) to head (c50fe43).

Files Patch % Lines
src/JustSaying/JustSayingBus.cs 66.66% 23 Missing and 2 partials ⚠️
...ng/AwsTools/MessageHandling/SqsMessagePublisher.cs 68.42% 20 Missing and 4 partials ⚠️
...ng/AwsTools/MessageHandling/SnsMessagePublisher.cs 79.12% 15 Missing and 4 partials ⚠️
...JustSaying/Fluent/MessagingConfigurationBuilder.cs 27.77% 10 Missing and 3 partials ⚠️
...ng/Fluent/PublishConfig/DynamicMessagePublisher.cs 77.77% 6 Missing and 2 partials ⚠️
....StructureMap/ConfigurationExpressionExtensions.cs 76.47% 3 Missing and 1 partial ⚠️
.../AwsTools/MessageHandling/PublishBatchException.cs 33.33% 4 Missing ⚠️
...tSaying/Fluent/TopicAddressPublicationBuilder`1.cs 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1335      +/-   ##
==========================================
- Coverage   79.43%   78.68%   -0.75%     
==========================================
  Files         138      140       +2     
  Lines        3234     3557     +323     
  Branches      448      501      +53     
==========================================
+ Hits         2569     2799     +230     
- Misses        434      511      +77     
- Partials      231      247      +16     
Flag Coverage Δ
linux 78.68% <74.80%> (-0.75%) ⬇️
macos 46.44% <35.36%> (-1.49%) ⬇️
windows 46.44% <35.36%> (-1.49%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +3 to +5
<PackageVersion Include="AWSSDK.SimpleNotificationService" Version="3.7.300" />
<PackageVersion Include="AWSSDK.SQS" Version="3.7.300" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the minimum versions that support .NET 8 and AoT, so I think they're worth raising the baseline to as part of getting the batch publishing support.

@@ -106,10 +106,12 @@ public Uri GetQueueUriByConvention<T>()
/// <returns>The <see cref="Uri"/> for this queue.</returns>
public Uri GetQueueUri(string queueName)
{
#pragma warning disable CS0618 // Type or member is obsolete
var hostname = _regionEndpoint.GetEndpointForService("sqs").Hostname;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is obsolete, but using the new way is difficult to do for libraries without breaking compatibility or making things harder for consumers, so keeping using the old way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was internal and just syntactic sugar, so I just removed it.

martincostello and others added 14 commits April 8, 2024 09:41
Add support for batch publishing messages to SNS.
Supersedes justeattakeaway#1098.

Co-Authored-By: Rafael Lillo <7280959+lillo42@users.noreply.github.com>
- Remove some new methods to reduce new public API surface.
- Add missing XML documentation.
- Some minor code style fix-ups.
Apply outstanding review comments from justeattakeaway#1098.
Add more coverage for batch publishing.
Fix two broken tests.
Ensure that messages with dynamic topics are not all sent to the topic associated with the first message in a batch.
Extend the `Interrogate()` response for a dynamic message publisher to return the publishers and the batch publishers.
Condense the syntax.
Manual editing meant a missed comma.
Refactor things to make the public API analyser happy.
Add new unshipped members to baselines.
Fix test broken by 366fd64.
Use the explicit token option, rather than setting an environment variable.
Add new batch publishing APIs.
Bump version to 7.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement .NET Pull requests that update .net code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant