Upgrade to v21.0.0
In general, all major components in the Shuttle space have a semver version number starting at 21.0.0.
Breaking Changes
Please note that there are quite a few breaking changes.
Shuttle.Core
Note: All
Shuttle.Core.*packages have been renamed toShuttle.*(dropped theCore).
Shuttle.Contract
- Throwing
ArgumentNullExceptioninstead ofNullReferenceExceptionforAgainstNullandAgainstNullOrEmptyString.
Shuttle.Data
Note: This package has been deprecated.
Shuttle.Mediator
- All participants now registered as
Scopedby default.
Shuttle.Pipelines
- The
CancellationTokenhas been removed fromIPipelineContextand been added toIPipelineObserver<T>.ExecuteAsync(IPipelineContext<T> pipelineContext, CancellationToken cancellation = default).
Shuttle.Esb -> Shuttle.Hopper
Note:
Shuttle.Esbhas been deprecated andShuttle.Hoppernow contains service bus functionality.
BREAKING: The TransportMessage has breaking changes but any messages sent from Shuttle.Esb may still be processed by a Shuttle.Hopper endpoint. However, messages sent from a Shuttle.Hopper endpoint will fail if processed by a Shuttle.Esb endpoint. Please upgrade all related endpoints together.
Packages
The following packages have been renamed to align with Shuttle.Hopper and using SqlServer instead of Sql:
Shuttle.Esb->Shuttle.HopperShuttle.Esb.AmazonSqs->Shuttle.Hopper.AmazonSqsShuttle.Esb.AzureEventHubs->Shuttle.Hopper.AzureEventHubsShuttle.Esb.AzureStorageQueues->Shuttle.Hopper.AzureStorageQueuesShuttle.Esb.Kafka->Shuttle.Hopper.KafkaShuttle.Esb.RabbitMQ->Shuttle.Hopper.RabbitMQShuttle.Esb.Sql.Queue->Shuttle.Hopper.SqlServer.QueueShuttle.Esb.Sql.Subscription->Shuttle.Hopper.SqlServer.Subscription
Any other Shuttle.Esb.* packages present in v20 are not currently available in this release.
Package Registration Convention
Previously, service bus functionality and transports were configured directly on the IServiceCollection instance:
services.AddServiceBus(builder => { /* ... */ });
services.AddAmazonSqs(builder => { /* ... */ });
services.AddRabbitMQ(builder => { /* ... */ });In Shuttle.Hopper, configuration has been consolidated into a fluent builder API. You first call AddHopper on the IServiceCollection, and then chain transport and feature configurations using the .Use[Component]() pattern:
services.AddHopper(options =>
{
// Configure HopperOptions here
})
.UseAmazonSqs(builder => { /* ... */ })
.UseRabbitMQ(builder => { /* ... */ });Transport Configuration Options
Across all transports, the approach to customizing the underlying provider has changed. Previously, many options classes exposed event EventHandler properties (e.g., Configure, ConfigureConsumer, ConfigureBlobStorage) to hook into or override provider-specific settings.
These events have been removed and replaced with direct properties on the respective options classes to supply the configuration or builders natively.
- AmazonSqs: Removed the
Configureevent and theServiceUrlproperty. AddedAWSCredentials AwsCredentialsandAmazonSQSConfig AmazonSqsConfigproperties. - AzureStorageQueues: Removed the
Configureevent. Added aQueueClientOptions QueueClientproperty. - AzureEventHubs: Removed
ConfigureBlobStorage,ConfigureProcessor, andConfigureProducerevents. Replaced byBlobClientOptions BlobClient,EventProcessorClientOptions ProcessorClient, andEventHubProducerClientOptions ProducerClientproperties. TheProcessErrorevent is now anAsyncEvent<EventHubProcessErrorEventArgs>property. - Kafka: Removed
BuildConsumer,BuildProducer,ConfigureConsumer, andConfigureProducerevents. Replaced by directConsumerBuilder,ProducerBuilder,ConsumerConfig, andProducerConfigproperties. - RabbitMQ: Removed the
Configureevent. Added aConnectionFactory ConnectionFactoryproperty.
Inbox options
WorkQueueUrirenamed toWorkTransportUri.DeferredQueueUrirenamed toDeferredTransportUri.ErrorQueueUrirenamed toErrorTransportUri.DurationToIgnoreOnFailurerenamed toIgnoreOnFailureDurations.
TransportMessage
DateTime ExpiryDatechanged toDateTimeOffset ExpiresAt.DateTime IgnoreTillDatechanged toDateTimeOffset IgnoreUntil.DateTime SendDatechanged toDateTimeOffset SentAt.
TransportMessageBuilder
Local()renamed toToSelf().Defer()renamed toDeferUntil(DateTimeOffset)andDeferFor(TimeSpan).WillExpire()renamed toExpiresAt(DateTimeOffset)andExpiresIn(TimeSpan).
Shuttle.Esb.Sql.Subscription (now Shuttle.Hopper.SqlServer.Subscription)
Previously the SQL subscription service was registered like this:
services
.AddSqlSubscription()
.AddServiceBus(builder =>
{
builder.Options.Subscription.ConnectionStringName = "ProcessManagement";
});It now needs to be registered via the AddHopper builder like this:
services
.AddHopper(options =>
{
// configure hopper options
})
.UseSqlServerSubscription(options =>
{
options.ConnectionString = "Data Source=...";
options.Schema = "dbo"; // Optional. Defaults to `dbo`
});Shuttle.Recall
Packages
The following packages have been renamed to use SqlServer instead of Sql:
Shuttle.Recall.Sql.EventProcessing->Shuttle.Recall.SqlServer.EventProcessingShuttle.Recall.Sql.Storage->Shuttle.Recall.SqlServer.Storage
Changes
- Renamed
IAsyncEventHandlertoIEventHandler. - Removed
EventStore.CreateEventStream. UsingEventStore.GetAsyncwill return an empty event stream if none exists. - Renamed
EventStream.AddEventtoEventStream.Add. - Removed snapshots as such funcationality should be modelled explicity, for instance using the Closing the Books pattern.