-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support SNS batch publishing #1335
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1335 +/- ##
==========================================
- Coverage 79.49% 78.34% -1.16%
==========================================
Files 138 140 +2
Lines 3234 3556 +322
Branches 448 501 +53
==========================================
+ Hits 2571 2786 +215
- Misses 433 522 +89
- Partials 230 248 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Directory.Packages.props
Outdated
<PackageVersion Include="AWSSDK.SimpleNotificationService" Version="3.7.300" /> | ||
<PackageVersion Include="AWSSDK.SQS" Version="3.7.300" /> |
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.
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; |
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.
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.
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.
This will need revisiting with AWSSDK v4 as this has been removed completely.
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.
This was internal and just syntactic sugar, so I just removed it.
1cc99f5
to
40d62da
Compare
3dad5d1
to
51797df
Compare
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.
Ensure that messages with dynamic topics are not all sent to the topic associated with the first message in a batch.
Condense the syntax.
Manual editing meant a missed comma.
Refactor things to make the public API analyser happy.
Add new unshipped members to baselines.
Use the explicit token option, rather than setting an environment variable.
Add new batch publishing APIs.
51797df
to
5aa9601
Compare
Bump version to 7.2.
This should be ready to test at your convenience now @hwoodiwiss. |
Tested internally, looks good to me, it worked well. 🎉 |
@slang25 Do we want to make this part of 8? If so, I'll update the version number again before merging. |
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've reviewed down to src/JustSaying/IPublishBatchConfiguration.cs, I'll try and get back to this soon. Just a few minor changes so far.
|
||
if (response.Successful.Count > 0 && _logger.IsEnabled(LogLevel.Information)) | ||
{ | ||
_logger.LogInformation( |
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 didn't see this success log in my testing, I only saw the one that I'd added, though it did definitely successfully send the notifications.
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.
Did you have a log filter configured on JustSaying messages?
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.
No, and in the previous version, we do get the logs for individual message publishes. I'll have another look tomorrow.
Apply feedback to comments and log messages.
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.
Just a few more spelling bits, and a comment on the API surface
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 don't think these are worth blocking over, I just think it would be clearer if we disambiguated the log messages for batches.
src/JustSaying/JustSayingBus.cs
Outdated
{ | ||
if (PublishBatchConfiguration.PublishFailureReAttempts == 0) | ||
{ | ||
_log.LogWarning("You have not set a re-attempt value for publish failures. If the publish location is not available you may lose messages."); |
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.
_log.LogWarning("You have not set a re-attempt value for publish failures. If the publish location is not available you may lose messages."); | |
_log.LogWarning("You have not set a re-attempt value for batch publish failures. If the publish location is not available you may lose messages."); |
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.
A few more spellings
tests/JustSaying.IntegrationTests/Fluent/Publishing/WhenAMessageIsPublishedToAQueue.cs
Outdated
Show resolved
Hide resolved
tests/JustSaying.IntegrationTests/Fluent/Publishing/WhenAMessageIsPublishedToATopic.cs
Outdated
Show resolved
Hide resolved
- Fix typos. - Make messages more specific to batches. - Style refactor.
- Extend the integration tests to include publishing to multiple topics in a single batch. - Fix broken test assertion after previous refactor. - Disable IDE0130.
Do we still want to bump the major version for this, or do we want to have this as the last big thing for v7, as it should be backwards-compatible. |
A big part of me wants to put this in to a V8. The compression work is almost done (but there is a lot to review). |
@slang25 What do you want to do with this PR? Is it ready to merge, or does it need to wait on something else? |
Use 3.7.400 series.
Unless there's any objections in the next 24 hours, I'm going to merge this tomorrow and it'll just sit in main until whenever we do another release. |
Add support for batch publishing messages to SNS.
Supersedes #1098.
TODO
Review original feedback from GH-1095 Add support to batch operation #1098 and address.Check test coverage.Rebase on Add public API analyzer #1330 and add updated baselines.Update version to 7.2.0.