RockLib.Messaging 2.0.0

A simple API for sending and receiving messages.

There is a newer version of this package available.
See the version list below for details.
Install-Package RockLib.Messaging -Version 2.0.0
dotnet add package RockLib.Messaging --version 2.0.0
<PackageReference Include="RockLib.Messaging" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RockLib.Messaging --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

RockLib.Messaging version 2.0.0

- Changes to `MessagingScenarioFactory`:
 - No longer has a concept of "queue vs topic". The factory methods are `CreateSender` and `CreateReceiver`.
 - Uses `IConfiguration` as its data source instead of `IMessagingScenarioFactory` (which no longer exists).
 - Configurations are assumed to have the subsections, `Senders` and/or `Receivers` (case-insensitive), that respectively contain one or more type-defined implementations of `ISender` and `IReceiver`.
 - Uses `RockLib.Configuration.Config.Root.GetSection("RockLib.Messaging")` as the default value for its configuration.
   - Can call `MessagingScenarioFactory.SetConfiguration` to set the configuration programmatically.
 - Has `CreateSender` and `CreateReceiver` extension methods that work with any instance of `IConfiguration` to create senders and receivers.
 - Adds optional `defaultTypes`, `valueConverters`, `resolver`, and `reloadOnConfigChange` parameters to the create methods, allowing greater customization of the sender or receiver.
- Changes to the sending API:
 - There is no longer an `ISenderMessage` interface, just the concrete `SenderMessage` class.
   - Automatically handles encoding and compression.
   - Replaces the `MessageFormat` property with `IsBinary`.
   - Renames `StringValue` and `BinaryValue` properties to `StringPayload` and `BinaryPayload`.
   - Removes the `Priority` property.
 - The `ISender` interface's `SendAsync` method takes a `CancellationToken` parameter.
- Changes to the receiving API:
 - `IReceiverMessage`
   - The `Acknowledge` method is renamed to `AcknowledgeAsync` and made asynchronous (it returns a `Task`).
   - Adds `RollbackAsync` and `RejectAsync` methods.
     - RollbackAsync allows users to indicate that a message was not successfully processed but should be (or should be allowed to be) redelivered.
     - RejectAsync allows users to indicate that a message could not be successfully processed and should not be redelivered.
     - AcknowledgeAsync allows users to indicate that a message was successfully processed and should not be redelivered.
   - Adds `Handled` property.
     - Returns false for a message that has not yet been handled by the `AcknowledgeAsync`, `RollbackAsync`, or `RejectAsync` methods.
     - Returns true for a message after it has been handled by the `AcknowledgeAsync`, `RollbackAsync`, or `RejectAsync` methods.
   - Replaces `GetStringValue` and `GetBinaryValue` methods with `StringPayload` and `BinaryPayload` properties.
   - Replaces `GetHeaderValue` and `GetHeaderNames` methods with `Headers` property.
   - Removes the `Priority` property.
 - `IReceiver`
   - The `MessageReceived` event and `Start` method are replaced by the read/write `MessageHandler` property of type `IMessageHandler`.
   - The receiver is started when the property is set.
   - The receiver calls the `OnMessageReceivedAsync` method of its `MessageHandler` when a message is received.
   - A receiver can also be started by invoking the `Start` extension method.
     - The delegate parameter passed to the extension method is invoked when the receiver receives a message.
   - Adds an `Error` event for implementations to invoke when an internal error occurs - useful when errors originate in a background thread.
 - `Receiver` base class
   - An abstract class to simplify implementations of the `IReceiver` interface and make them more consistent.
   - Adds validation in the setter of the `MessageHandler` property so the a receiver can only be started once. Also disallows a null value.
 - `ReceiverMessage` base class
   - An abstract class to simplify implementations of the `IReceiverMessage` interface and make them more consistent.
   - Its constructor handles the decoding and decompression of incoming message payloads, whether they be string or binary.
   - Provides an abstract method for implementations to populate its headers.
   - Provides abstract methods for the handler methods: `AcknowledgeAsync`, `RollbackAsync`, and `RejectAsync`.
   - Ensures that the message is only handled once.
- The Named Pipes feature has been moved to its own package, RockLib.Messaging.NamedPipes (it is no longer included in the main RockLib.Messaging package).
- Adds the RockLib.Messaging.SNS package.
 - Adds `SNSSender` class, which allows messages to be sent to an SNS topic.
- Changes to the RockLib.Messaging.SQS package:
 - Renames `SQSQueueSender` and `SQSQueueReceiver` to `SQSSender` and `SQSReceiver`.
 - Adds optional `region` parameter to `SQSSender` and `SQSReceiver`.
 - Adds optional `unpackSNS` flag to `SQSReceiver`.
   - Useful when the SQS queue receives messages from an SNS topic - the payloads of such messages contain a JSON object representing the entire raw SNS message.
   - When set, the JSON object is unpacked, and the body and headers are populated from the unpacked message.
- Adds RockLib.Messaging.Http package.
 - `HttpClientSender`
   - An ...truncated (10000 bytes)

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.3.0 37 5/26/2020
2.2.0 690 4/9/2020
2.1.0 704 3/3/2020
2.0.4 34,717 4/2/2019
2.0.3 181 3/20/2019
2.0.2 301 2/22/2019
2.0.1 978 2/1/2019
2.0.0 358 1/10/2019
2.0.0-alpha15 230 1/3/2019
2.0.0-alpha14 200 12/19/2018
2.0.0-alpha13 131 12/18/2018
2.0.0-alpha12 133 12/18/2018
2.0.0-alpha11 203 12/7/2018
2.0.0-alpha10 142 12/7/2018
2.0.0-alpha09 172 11/30/2018
2.0.0-alpha08 184 11/23/2018
2.0.0-alpha07 221 11/22/2018
2.0.0-alpha06 140 11/21/2018
2.0.0-alpha05 165 11/21/2018
2.0.0-alpha04 164 11/15/2018
2.0.0-alpha03 187 11/14/2018
2.0.0-alpha02 140 11/9/2018
2.0.0-alpha01 170 10/22/2018
1.0.2 2,949 8/27/2018
1.0.1 703 4/6/2018
1.0.0 459 12/20/2017
Show less