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
IPublisher
as transient instead of scoped to allow injecting it into singleton services - Add
CancellationToken
support to the mediator - Improve builders for error policies
- Support subscribers returning
ValueTask
- Support exponential delay in
RetryErrorPolicy
- Add new
AddHeader
,WithMessageId
andWithKafkaKey
overloads inProducerEndpointConfigurationBuilder
for easier and more readable configuration - Introduce typed endpoints registration using
Consume<TMessage>
andProduce<TMessage>
methods (replacingAddInbound
andAddOutbound
), 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
BinaryMessageDeserializer
according 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
IInboundEnvelope
extensions to get broker specific metadata such asGetKafkaOffset()
,GetKafkaTimestamp()
,GetMqttResponseTopic()
andGetMqttCorrelationData()
- Add
IOutboundEnvelope
extensions to set broker specific metadata such asSetKafkaKey()
,SetMqttResponseTopic()
andSetMqttCorrelationData()
- Add
WrapAndProduce
andWrapAndProduceAsync
methods toIPublisher
to allow envelope enrichment (setting headers, kafka key, etc.) and dynamic routing - Add
WrapAndProduceBatch
andWrapAndProduceBatchAsync
methods toIPublisher
with the same capabilities ofWrapAndProduce
andWrapAndProduceAsync
, supporting streaming, mapping and efficient batching with Kafka - Refactor and improve
EntityFrameworkDomainEventsPublisher
- Improve
ITestingHelper
to allow waiting for specific topics to be consumed - Add
InboundEnvelopeBuilder
andOutboundEnvelopeBuilder
to 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
IgnoreNoMatchingSubscribersError
setting to MQTT producer endpoints, to prevent throwing when no subscriber is consuming the produced message - Basic support for MQTT 5 request-response
- Add
ConsumerNameFilterAttribute
to filter the subscribers by consumer name (replacesKafkaGroupIdFilterAttribute
andSubscribers.MqttClientIdFilterAttribute
) - Add new built-in (de-)serializers to support raw
string
,Stream
andbyte[]
- 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
,ICommandPublisher
andIQueryPublisher
replaced 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.
ISilverbackBuilder
toSilverbackBuilder
) AddOutbound
/AddInbound
methods have been replaced byAddKafkaClients
/AddMqttClients
andProduce
/Consume
methodsBatchSettings
,ChunkSettings
,SequenceSettings
,EncryptionSettings
, etc. renamed toBatchConfiguration
,ChunkConfiguration
,SequenceConfiguration
,EncryptionConfiguration
, etc.Configure
method for Kafka clients replaced by configuration methods such asWithBootstrapServers
,WithGroupId
,WithClientId
, etc.IBrokerCallback
andAdd*BrokerCallbackHandler
methods renamed toIBrokerClientCallback
andAdd*BrokerClientCallback
- ... (many more changes)
- Split the
IMessageSerializer
interface intoIMessageSerializer
andIMessageDeserializer
- 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 theUseModel
configuration method - Removed the whole
IBroker
andIBrokerCollection
constructs- They are superseded by the
IProducerCollection
andIConsumerCollection
interfaces, as well as theIBrokerClientCollection
which grants access to all underlying broker clients
- They are superseded by the
- Changed some details in
IProducer
/IConsumer
and their implementations - A lot of methods have been changed to return a
ValueTask
instead of aTask
- Kafka key won't be set to a random
Guid
anymore but will benull
if not explicitly set - Some changes to default settings:
- Increased default
KafkaConsumerConfiguration.MaxDegreeOfParallelism
to 100 - Increased default
KafkaConsumerConfiguration.BackpressureLimit
to 50 - Changed default
NewtonsoftJsonMessageDeserializer
typename handling toTypeNameHandling.None
to lay on the safe side
- Increased default
- Several changes have been made to
ITestingHelpe
>,IKafkaTestingHelper
, andSilverback.Testing.IMqttTestingHelper
- Removed the
AddSubscribers
methods 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
IgnoreUnhandledException
when batch processing [#216]
See docs for details.