azure_messaging_eventhubs@0.15.0
Pre-release
Pre-release
0.15.0 (Unreleased)
Features Added
- The
EventProcessornow opens every partition receiver with AMQP epoch (owner level)0and surfaces broker-initiated displacement as the newEventHubsError::ConsumerDisconnectederror kind. When a secondEventProcessorinstance claims a partition this instance is currently holding, the broker disconnects this instance's receiver and the consumer'sstream_events()resolves withConsumerDisconnected. This matches the behavior ofEventProcessorClientin the .NET and Java Azure SDKs. Consumers should pattern-match onErrorKind::ConsumerDisconnectedto detect a stolen partition and re-acquire a client vianext_partition_client(). - Added
EventHubsError::ConsumerDisconnected(Option<AmqpDescribedError>)error variant.
Breaking Changes
- On the receive path, the
amqp:link:stolenAMQP condition is no longer auto-retried. A receiver displaced by a higher-or-equal-epoch attacher now surfaces the error (translated toEventHubsError::ConsumerDisconnectedbyEventReceiver::stream_events) instead of silently re-attaching. Sender, CBS, and management operations retain the historical retry-on-stolen behavior.
Bugs Fixed
- Increased
DEFAULT_PARTITION_EXPIRATION_DURATIONfrom 10 seconds to 60 seconds. The previous default was shorter thanDEFAULT_UPDATE_INTERVAL(30 seconds), so ownership records expired between load-balancing cycles. The load balancer perpetually sawcurrent=0for every consumer and continuously re-claimed partitions, causing widespread duplicate event processing.EventProcessorBuilder::buildnow rejects configurations wherepartition_expiration_duration <= update_interval. (#3851) - The
EventProcessor's load-balancer reconciliation now closes the underlying AMQP receiver for any partition that has been reassigned to another consumer, so the consumer'sstream_events()resolves and the loop can terminate. Previously a stolen partition's client could continue to attempt receives until the broker tore down the link.