-
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
Merged
martincostello
merged 21 commits into
justeattakeaway:main
from
martincostello:support-batch-publishing
Oct 3, 2024
Merged
Changes from 16 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6582497
Support SNS batch publishing
martincostello be7382e
Code clean-up
martincostello 8421ff4
Apply code review feedback
martincostello ad89219
Extend test coverage
martincostello c49b351
Fix tests
martincostello 714f999
Group batch by topic
martincostello f60e93d
Fix test
martincostello efa5332
Simplify scope
martincostello 35f8115
Fix approval
martincostello e5737a2
Fix compatibility warnings
martincostello 43524f0
Update public API
martincostello 96d378d
Fix test
martincostello 7b7f138
Use token option
martincostello 5aa9601
Update baseline for net8.0
martincostello c50fe43
Bump version
martincostello 346407e
Merge branch 'main' into support-batch-publishing
martincostello 4923c4a
Fix comments and logs
martincostello 96c994d
Review feedback
martincostello 42dbb52
Extend tests
martincostello fd6cb49
Update AWSSDKs
martincostello a23f503
Fix build
martincostello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/JustSaying/AwsTools/MessageHandling/MessageBatchResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Net; | ||
using Amazon.Runtime; | ||
|
||
namespace JustSaying.AwsTools.MessageHandling; | ||
|
||
/// <summary> | ||
/// A class representing the response from publishing a batch of messages. | ||
/// </summary> | ||
public class MessageBatchResponse | ||
{ | ||
/// <summary> | ||
/// Gets or sets the Ids of the messages that were successfully published. | ||
/// </summary> | ||
public IReadOnlyCollection<string> SuccessfulMessageIds { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Ids of the messages that failed to publish. | ||
/// </summary> | ||
public IReadOnlyCollection<string> FailedMessageIds { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the response metadata. | ||
/// </summary> | ||
public ResponseMetadata ResponseMetadata { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the HTTP status code returned from the publish attempt, if any. | ||
/// </summary> | ||
public HttpStatusCode? HttpStatusCode { set; get; } | ||
} |
58 changes: 58 additions & 0 deletions
58
src/JustSaying/AwsTools/MessageHandling/PublishBatchException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#if NETFRAMEWORK | ||
using System.Runtime.Serialization; | ||
#endif | ||
|
||
namespace JustSaying.AwsTools.MessageHandling; | ||
|
||
/// <summary> | ||
/// Represents errors that occur publishing a batch of messages. | ||
/// </summary> | ||
#if NETFRAMEWORK | ||
[Serializable] | ||
#endif | ||
public class PublishBatchException : PublishException | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PublishBatchException"/> class. | ||
/// </summary> | ||
public PublishBatchException() | ||
: base("Failed to publish batch of messages") | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PublishBatchException"/> class. | ||
/// </summary> | ||
/// <param name="message">The message that describes the error.</param> | ||
public PublishBatchException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PublishBatchException"/> class. | ||
/// </summary> | ||
/// <param name="message">The message that describes the error.</param> | ||
/// <param name="inner">The exception that is the cause of the current exception, if any.</param> | ||
public PublishBatchException(string message, Exception inner) | ||
: base(message, inner) | ||
{ | ||
} | ||
|
||
#if NETFRAMEWORK | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PublishBatchException"/> class. | ||
/// </summary> | ||
/// <param name="info"> | ||
/// The <see cref="SerializationInfo"/> that holds the serialized object data | ||
/// about the exception being thrown. | ||
/// </param> | ||
/// <param name="context"> | ||
/// The <see cref="StreamingContext"/> that contains contextual information about the source or destination. | ||
/// </param> | ||
protected PublishBatchException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ | ||
} | ||
#endif | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.