Skip to content

v5.10.0

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Nov 21:21
· 31 commits to main since this release

What's New

  • Return the result of the forwarded query or command from ExecuteQuery and ExecuteCommand when the subscriber returns another query or command to be republished
  • Add the Kafka consumer catch-up, to get notified via IKafkaConsumerCaughtUpCallback (and optionally disconnect) once all messages of the assigned partitions are processed
  • Add ConsumeFromBeginning to consume all partitions of a Kafka topic from the beginning
  • Reduce allocations and improve performance of the message bus and of the producer and consumer pipelines

Fixes

  • Fix the subscriber filters, such as the MqttClientIdFilterAttribute or a custom one, preventing the batch and stream subscribers from receiving any message
  • Preserve the original stack trace of the exceptions thrown by the subscribers consuming an IMessageStreamObservable (or IObservable<T>)
  • Fix the messages returned by a subscriber in an IObservable<T> (with AsObservable()) never reaching their subscribers
  • Fix the subscribers consuming an IObservable<T> hanging when the observer throws from OnCompleted, and committing the batch or stream without applying the error policies when the handler behind an Rx operator (e.g., ToList()) throws
  • Fix the batches containing a chunked BinaryMessage that the subscriber doesn't read to the end, which could ignore the error policies, stall the consumer or its stop, or log a fatal error and disconnect the consumer
  • Fix the Kafka offsets committed when a chunked message is discarded or aborted as incomplete while consuming in batches, which could lose the pending messages of the batch, or consume the already processed ones again, after a restart or rebalance
  • Store the offsets of the messages skipped or moved by the error policies, and of the discarded chunks, in the Kafka client side offset store, instead of consuming them again after a restart or rebalance
  • Fix the Kafka transactional producer failing to begin any further transaction after being recreated because of a fatal error, or after reconnecting
  • Stop the consumer cleanly, raising the IConsumerTransactionManager.Aborting and IConsumerTransactionManager.Aborted events, when the error handling fails (e.g., an error policy callback throws or the move policy can't produce the message)
  • Apply the error policies when the commit of a batch fails, also when its subscriber stopped enumerating it early
  • Stop the consumer without applying the error policies when the commit fails after the consumer was committed (e.g., a IConsumerTransactionManager.Committed handler throws), instead of retrying, skipping or moving the already processed message
  • Fix the consumer ignoring all further reconnect requests (e.g., after a Kafka poll timeout) once stopping it to reconnect failed
  • Fix some race conditions, for example reading the consumer IConsumerStatusInfo.History (as the health check does) while its status changes, or an event handler removing itself while being invoked
  • Include the activity tags, such as the Kafka key, in the logging scope of the produced message
  • Log the broker message identifier of the messages produced from the outbox
  • Fix the header values (including the [Header] properties) of type Nullable<T>, Guid, TimeSpan, enum or DateTimeOffset being read back as null or the default value, and the numeric ones read back wrong when written under a non-invariant culture, or the DateTime ones shifted to local time or misparsed
  • Fix ExecuteCommand and ExecuteQuery throwing an InvalidOperationException instead of returning null when the subscriber returns null, and IPublisher Publish<TResult> discarding the null results
  • Fix the synchronous Dispose of the service provider throwing an InvalidOperationException (type only implements IAsyncDisposable), which could leave the broker clients connected
  • Fix EnableChunking rejecting a chunk size of 1
  • Fix the x-chunk-count header stating more chunks than produced when the message stream is not read from its beginning
  • Fix a message being silently dropped instead of produced when chunking is enabled and its stream is empty or already read to its end
  • Fix producing a tombstone (or a BinaryMessage with null content) throwing an InvalidOperationException when chunking is enabled with alwaysAddHeaders (the default)
  • Fix a partially read MemoryStream being produced from its start, instead of from its current position like any other stream
  • Fix the SymmetricEncryptStream returning wrong encrypted data when read with an offset, a short count or a span
  • Fix the JsonMessageSerializer and JsonMessageDeserializer instances (and the endpoint configurations containing them) never being equal on .NET 11, even with the same options
  • Fix ITestingHelper.GetProducerForEndpoint with the schema registry deserializers (Avro, Protobuf, JSON) and with the MQTT endpoints subscribing multiple topics, shared subscriptions or wildcard topic filters
  • Make the producer returned by ITestingHelper.GetProducerForEndpoint encrypt the messages and use the QoS level and protocol version of the consumer endpoint, and resolve the friendly name to that endpoint only
  • Fix some race conditions in the mocked Kafka consumer and schema registry, which could throw, or deliver a message of a partition just revoked or sought
  • Fix the mocked MQTT client never reconnecting after a connection attempt delayed via IMockedMqttOptionsBuilder.DelayConnection was canceled
  • Fix the mocked MQTT broker sessions: a QoS 0 message whose connection closed before the acknowledgment no longer stays pending forever (timing out ITestingHelper.WaitUntilAllMessagesAreConsumedAsync), the MQTT 5 sessions honor their session expiry interval instead of the clean start flag, and a client connecting with an already used client id takes over the session, disconnecting the other instance (SessionTakenOver) like the broker

See docs for details.