# 7.2.3

Release notes from 7.2.1 and 7.2.2 were not created, those releases were mostly bug fixes and stability improvements.

# Message Data Objects

Originally, message data (claim check) only supported byte[] and string, with Stream added. With this release, it is now possible to specify an object type T. For instance:

public interface ValidateOrder
{
    Guid CorrelationId { get; }
    MessageData<Order> Order { get; }
}

MassTransit will serialize the Order object, and transfer that object as message data (which may be inline, if the size is below the threshold). The object T must be a valid message type, to meet the serialization requirements. The message data can be initialized by passed the appropriate type via the message initializer.

await endpoint.Send<ValidateOrder>(new
{
    InVar.CorrelationId,
    Order = new {
        OrderId = orderId,
        BigProperty = bigProperty,
        // etc...
    }
});

# SQS Visibility Timeout

MassTransit will now adjust the visibility timeout of messages until consumers complete, extending the timeout at regular intervals automatically to prevent message re-delivery after the default timeout (typically 30 seconds).

# Request Client Pipe Configuration

The request client has new overloads to set headers, etc. when calling GetResponse<T>. For example:

await client.GetResponse<B>(new A(), context => context.TimeToLive = TimeSpan.FromMinutes(30), x.CancellationToken);

# System.Text.Json

While Newtonsoft.JSON is still the default serializer, experimental support has been added for System.Text.Json. By default, it's a separate serialization media type to avoid compatibility issues. However, it can be configured to replace the default media type by configuring the bus to use System.Text.Json only.

x.UsingRabbitMQ((context, cfg) =>
{
    cfg.UseSystemTextJsonOnly();
});

Due to limitations in System.Text.Json, it is not 100% compatible with Newtonsoft.JSON. But in most cases, it works. It's clearly some edge message types that are unable to be serialized and/or deserialized.

# Raw XML Serialization

To complement the built-in raw JSON support, a new raw XML serializer has been added.

# Non-Generic AddConsumer, AddSaga methods

The non-generic methods such as AddConsumer and AddSaga can now configure Endpoint details. Previously this was only available on the generic AddConsumer<T> style methods. The bulk methods remain unchanged.

# Miscellaneous

  • FutureState storage for Entity Framework Core now works with multiple DbContext types in the container.
  • Better support for SQS FIFO queues/topics
  • Optimistic concurrency support for job consumer saga repository (EFCore)
  • Fixed weird shutdown issue with ActiveMQ consumers draining the queue
  • Fixed tokenId header issue with Azure Service Bus scheduler that prevented state machine scheduled messages from being properly correlated to the job service sagas
  • Changed checkpoint logic for Event Hub and Kafka to update after a timeout, not just a message count