-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement fire and forget send (#117)
- Loading branch information
Showing
4 changed files
with
102 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
namespace ActiveMQ.Artemis.Core.Client; | ||
|
||
/// <summary> | ||
/// A producer sends messages to ActiveMQ Artemis addresses. | ||
/// </summary> | ||
public interface IProducer : IAsyncDisposable | ||
{ | ||
/// <summary> | ||
/// Sends a message synchronously to the broker. This method is primarily used for non-durable | ||
/// message delivery since it does not wait for a confirmation from the broker and operates | ||
/// in a fire-and-forget manner. | ||
/// </summary> | ||
/// <remarks> | ||
/// This method should typically be used when message delivery speed is prioritized over reliability. | ||
/// The message will be sent with 'at most once' delivery guarantee, as there's no acknowledgment | ||
/// from the broker that the message has been received or persisted. | ||
/// </remarks> | ||
void SendMessage(Message message); | ||
|
||
/// <summary> | ||
/// Sends a message asynchronously to the broker. This method supports both durable and non-durable message | ||
/// delivery modes, as specified by the message's durable property. It awaits for a confirmation | ||
/// from the broker, ensuring that the message is either stored (for durable messages) or acknowledged | ||
/// (for non-durable messages) before completing. | ||
/// </summary> | ||
/// <remarks> | ||
/// This method should be used when reliability is required, and it supports awaiting the acknowledgment | ||
/// from the broker. The delivery semantics are 'at least once' for durable messages, where the broker | ||
/// confirms the persistence of the message. For non-durable messages, the completion of the task | ||
/// indicates that the broker has received the message. | ||
/// </remarks> | ||
ValueTask SendMessageAsync(Message message, CancellationToken cancellationToken = default); | ||
} |
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