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)

NuGet packages (8)

Showing the top 5 NuGet packages that depend on RockLib.Messaging:

Package Downloads
RockLib.Messaging.SQS
Implementation of RockLib.Messaging API that sends and receives messages using Amazon SQS. This package was built from the source code at https://github.com/RockLib/RockLib.Messaging/tree/6ed86b8110427fb25447223b3dc7d3cc7aa0d81b
RockLib.Messaging.NamedPipes
Implementation of RockLib.Messaging API that sends and receives messages to a local named pipe. This package was built from the source code at https://github.com/RockLib/RockLib.Messaging/tree/8f72c6f85b82c22c90c56933f01912c84b982cb6
RockLib.Messaging.Http
An implementation of RockLib.Messaging that sends and receives messages via HTTP. This package was built from the source code at https://github.com/RockLib/RockLib.Messaging/tree/a24476bb4476e8527a56d09da391a11ca1a616b9
RockLib.Messaging.SNS
Implementation of RockLib.Messaging API that sends messages using Amazon SNS. This package was built from the source code at https://github.com/RockLib/RockLib.Messaging/tree/444c85ee7c8526663c811223ac3ca0b269a10d56
RockLib.Messaging.RabbitMQ
Implementation of RockLib.Messaging API that sends and receives messages using RabbitMQ. This package was built from the source code at https://github.com/RockLib/RockLib.Messaging/tree/d1ea91f7809fea787ef038fc13eba4436c0be02e

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.4.2 97 7/30/2020
2.4.1 136 7/29/2020
2.4.0 173 7/15/2020
2.3.1 241 6/22/2020
2.3.0 5,790 5/26/2020
2.2.0 1,824 4/9/2020
2.1.0 1,187 3/3/2020
2.0.4 36,950 4/2/2019
2.0.3 219 3/20/2019
2.0.2 355 2/22/2019
2.0.1 1,251 2/1/2019
2.0.0 421 1/10/2019
2.0.0-alpha15 301 1/3/2019
2.0.0-alpha14 286 12/19/2018
2.0.0-alpha13 160 12/18/2018
2.0.0-alpha12 159 12/18/2018
2.0.0-alpha11 262 12/7/2018
2.0.0-alpha10 170 12/7/2018
2.0.0-alpha09 242 11/30/2018
2.0.0-alpha08 284 11/23/2018
2.0.0-alpha07 268 11/22/2018
2.0.0-alpha06 164 11/21/2018
2.0.0-alpha05 193 11/21/2018
2.0.0-alpha04 211 11/15/2018
2.0.0-alpha03 234 11/14/2018
2.0.0-alpha02 167 11/9/2018
2.0.0-alpha01 215 10/22/2018
1.0.2 2,979 8/27/2018
1.0.1 739 4/6/2018
1.0.0 503 12/20/2017
Show less