Releases: BEagle1984/silverback
Releases · BEagle1984/silverback
v4.6.2
v5.0.0-beta.1
Silverback 5.0.0 is the most significant update in the library’s history, built on years of user feedback and real-world experience. This release is more than just an upgrade, it’s a complete refactoring that enhances flexibility, performance, and maintainability while laying a strong foundation for future innovations.
What's New
- Clean up code and increase tests coverage
- Reduce allocations and improve performance in many places
- Register
IPublisheras transient instead of scoped to allow injecting it into singleton services - Add
CancellationTokensupport to the mediator - Improve builders for error policies
- Support subscribers returning
ValueTask - Support exponential delay in
RetryErrorPolicy - Add new
AddHeader,WithMessageIdandWithKafkaKeyoverloads inProducerEndpointConfigurationBuilderfor easier and more readable configuration - Introduce typed endpoints registration using
Consume<TMessage>andProduce<TMessage>methods (replacingAddInboundandAddOutbound), making the nested configuration more readable and type-safe - Automatically set the typed deserializer according to the message type when using
Consume<TMessage>to configure the endpoint - Automatically set the typed
BinaryMessageDeserializeraccording to the message type when usingConsume<TMessage>to configure the endpoint - Add full fluent API for Kafka and MQTT configuration
- Rewrite storage implementation from scratch and introduce new Silverback.Storage.PostgreSql, Silverback.Storage.Sqlite, Silverback.Storage.EntityFramework and Silverback.Storage.Memory packages
- Refactor transactional outbox adding support for transaction enlistment (even if not using Entity Framework) and improving performance
- Improve outbox worker reliability
- Add message filtering in producer configuration
- Improve and simplify tombstone handling
- Add
IInboundEnvelopeextensions to get broker specific metadata such asGetKafkaOffset(),GetKafkaTimestamp(),GetMqttResponseTopic()andGetMqttCorrelationData() - Add
IOutboundEnvelopeextensions to set broker specific metadata such asSetKafkaKey(),SetMqttResponseTopic()andSetMqttCorrelationData() - Add
WrapAndProduceandWrapAndProduceAsyncmethods toIPublisherto allow envelope enrichment (setting headers, kafka key, etc.) and dynamic routing - Add
WrapAndProduceBatchandWrapAndProduceBatchAsyncmethods toIPublisherwith the same capabilities ofWrapAndProduceandWrapAndProduceAsync, supporting streaming, mapping and efficient batching with Kafka - Refactor and improve
EntityFrameworkDomainEventsPublisher - Improve
ITestingHelperto allow waiting for specific topics to be consumed - Add
InboundEnvelopeBuilderandOutboundEnvelopeBuilderto testing packages to help creating test envelopes - Support Kafka cooperative sticky partition assignment strategy
- Implement transactional client-side offset storage
- Support Kafka transactions
- Add support for Confluent schema registry (Avro, Json and Protobuf), including mock for in-memory testing
- Add
IgnoreNoMatchingSubscribersErrorsetting to MQTT producer endpoints, to prevent throwing when no subscriber is consuming the produced message - Basic support for MQTT 5 request-response
- Add
ConsumerNameFilterAttributeto filter the subscribers by consumer name (replacesKafkaGroupIdFilterAttributeandSubscribers.MqttClientIdFilterAttribute) - Add new built-in (de-)serializers to support raw
string,Streamandbyte[] - Improve Activity handling for sequences (batch processing, chunking, etc.)
- Upgrade to Confluent.Kafka 2.8.0
- Upgrade to MQTTnet 5.0.1.1416
Breaking Changes
This release includes many breaking changes, as the library underwent a significant refactoring. The following list might be incomplete but should give you an overview of the most important changes:
IEventPublisher,ICommandPublisherandIQueryPublisherreplaced by extension methods onIPublisher- Refactored the configuration model and related fluent API
- Many types, properties and methods have been renamed or modified to improve readability, consistency, and ergonomics
- Reorganized the configuration namespaces, some extension methods might have been moved to a different namespace, thus requiring a different
using. - Changed the endpoint models and most of the configuration models to records with init-only properties
- Building the endpoints directly is still supported but the strongly recommended preferred way is to use the fluent API, therefore from now on the documentation will only show that approach
- Removed all builders interfaces and exposed the actual classes directly (e.g.
ISilverbackBuildertoSilverbackBuilder) AddOutbound/AddInboundmethods have been replaced byAddKafkaClients/AddMqttClientsandProduce/ConsumemethodsBatchSettings,ChunkSettings,SequenceSettings,EncryptionSettings, etc. renamed toBatchConfiguration,ChunkConfiguration,SequenceConfiguration,EncryptionConfiguration, etc.Configuremethod for Kafka clients replaced by configuration methods such asWithBootstrapServers,WithGroupId,WithClientId, etc.IBrokerCallbackandAdd*BrokerCallbackHandlermethods renamed toIBrokerClientCallbackandAdd*BrokerClientCallback- ... (many more changes)
- Split the
IMessageSerializerinterface intoIMessageSerializerandIMessageDeserializer - Outbox and all storage dependent features have been rewritten from scratch
- Exactly once guard has been replaced by the client side offset storage
Publishing.IPublisher> itself and removed theUseModelconfiguration method - Removed the whole
IBrokerandIBrokerCollectionconstructs- They are superseded by the
IProducerCollectionandIConsumerCollectioninterfaces, as well as theIBrokerClientCollectionwhich grants access to all underlying broker clients
- They are superseded by the
- Changed some details in
IProducer/IConsumerand their implementations - A lot of methods have been changed to return a
ValueTaskinstead of aTask - Kafka key won't be set to a random
Guidanymore but will benullif not explicitly set - Some changes to default settings:
- Increased default
KafkaConsumerConfiguration.MaxDegreeOfParallelismto 100 - Increased default
KafkaConsumerConfiguration.BackpressureLimitto 50 - Changed default
NewtonsoftJsonMessageDeserializertypename handling toTypeNameHandling.Noneto lay on the safe side
- Increased default
- Several changes have been made to
ITestingHelpe>,IKafkaTestingHelper, andSilverback.Testing.IMqttTestingHelper - Removed the
AddSubscribersmethods allowing to register subscribers via a base type or interface - ... (many more changes)
v4.6.1
v4.6.0
v4.5.1
v4.5.0
- Upgrade to Confluent.Kafka 2.4.0
- Upgrade to MQTTnet 4.3.6.1152
See docs for details.
v4.4.1
- Upgrade to Confluent.Kafka 2.3.0
- Upgrade to MQTTnet 4.3.2.930
See docs for details.
v4.4.0
- Allow parallel processing of MQTT messages
- Upgrade to MQTTnet 4.3.1.873
- Upgrade to Confluent.Kafka 2.2.0
- Correctly set message timestamp in mocked Kafka
- Properly handle Kafka partitions revoked event when no partitions were assigned [#214]
- Respect
IgnoreUnhandledExceptionwhen batch processing [#216]
See docs for details.