-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support SNS batch publishing (#1335)
Add support for batch publishing messages to SNS. Supersedes #1098. Co-Authored-By: Rafael Lillo <[email protected]>
- Loading branch information
1 parent
8d742ab
commit 42fe0a8
Showing
66 changed files
with
2,541 additions
and
155 deletions.
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
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.