Skip to content

3.0.0

Latest
Compare
Choose a tag to compare
@zarusz zarusz released this 15 Jan 21:50
· 2 commits to master since this release
637197e

Summary of changes:

  • OnHandle method in IConumer<T> and IRequestHandler<T, R> interfaces now accept CancellationToken parameter.

  • [Host.Serialization] Introduced a new optional interface IMessageSerializer<TPayload> for JSON serializers to work efficiently with non-binary payload transports (Amazon SQS/SNS client uses text payloads).

    • [Host.Serialization.Json] and [Host.Serialization.SystemTextJson] have been updated to also serialize into a string (in addition to byte arrays).
  • [Host.Configuration] Configuration improvements to make it easy to pass typed transport-specific settings via builders.

  • [Host.Outbox] Improvements

    • Renamed the plugin SlimMessageBus.Host.Outbox.DbContext to SlimMessageBus.Host.Outbox.Sql.DbContext to emphasize it builds on top of the SlimMessageBus.Host.Outbox.Sql plugin (MS SQL)
    • Extended with other Guid generation strategies (on server side, client side, and sequential Guids).
    • Performance improvements to SlimMessageBus.Host.Outbox.Sql.
  • [Host] Improvements

    • IConsumerErrorHandler pipeline improvements:
      • Ability to enable message scope re-creation with every message handling retry
      • Ability to abandon message (and fail fast in case of a non-transient issue to bypass transport level retries).
    • Batch Publish feature #338
    • Master bus improvements and refactoring:
      • Moved the IPendingRequestStore to be shared across master messages bus instances (request-response).
      • Moved Response Message handling purely to the ResponseMessageProcessor.
      • Refactored bus async initialization before the first message is produced or consumed.
  • [Host.AzureServiceBus] Added Correlation filters support

  • New Plugin: SlimMessageBus.Host.CircuitBreaker.HealthCheck plugin for Consumer Circuit Breaker based on health checks

  • New Plugin: SlimMessageBus.Host.AmazonSQS transport plugin for Azmazon SQS.

  • High-performance logging

  • Updated libraries to the latest versions

  • NET9: Include in multi-target, and upgrade tests and samples to NET9.

Migration Guide

01 Ensure all SMB packages are in major 3 version

Packages between v3 and v2 will not be compatible.
Ensure you reference packages from the major 3 version (3.0.0).

02 OnHandle has a CancellationToken parameter

The core interfaces IConsumer<T> and IRequestHandler<T, R> have the CancellationToken parameter added.

Update the consumer implementations to include that parameter, for example:

public class MyConsumer : IConsmer<MyMessage>
{
    // Before in SMB 2.x
    // public Task OnHandle(MyMessage message) {  }
    
    // Since SMB 3.x
    public Task OnHandle(MyMessage message, CancellationToken cancellationToken) {  }
}

03 SlimMessageBus.Host.Outbox.DbContext

The package SlimMessageBus.Host.Outbox.DbContext became SlimMessageBus.Host.Outbox.Sql.DbContext.
Please update the references in your projects. The configuration API should largely stay the same.

04 The IConsumerErrorHandler has a different signature

Consult the docs around error handling.

All the changes (PRs):

The main PR for v3 merge into master is: #320 (all the v3 changes).

Credits

Thanks to @EtherZa for all his contributions towards v3 milestone!