Azure.Messaging.EventHubs_5.0.0-preview.2
Pre-releaseGeneral
-
Public members of type
DateTime
were converted toDateTimeOffset
to explicitly represent that they are UTC -
Members of type
DateTimeOffset
have had theUtc
suffix removed from their names, as theDateTimeOffset
type removes ambiguity about the time zone -
Members representing a partition offset that were incorrectly exposed as
string
have been converted toint
to provide a unified type. -
Renamed all instances of
EventHubPath
toEventHubName
to align with the usage context and unify on the chosen semantics across the client library for different languages. -
Ongoing minor tweaks to formatting, wording, and spelling of documentation and XML document comments.
Publishing events
-
Reintroduced the
EventDataBatch
, allowing for publication of a batch of events with known size constraint. This is intended to ensure that publishers can build batches without the potential for an error when sending and to allow publishers with bandwidth concerns to control the size of each batch published. -
Enhanced the
EventHubProducer
to allow creation of anEventDataBatch
and to accept them for publication.
Consuming events
-
Added a means to subscribe to the events exposed by an
EventHubConsumer
in the form of an asynchronous iterator. Using the iterator, consumers are able to use the familiarforeach
pattern to enumerate events as they are available and process them. Optionally, consumers may specify a maximum time to wait for events to arrive which, when exceeded, will emit a null event if none were available, returning control to the loop and allowing cancellation or other processing needs. -
Introduced the initial concept of a new version of the
EventProcessor
, intended as a neutral framework for processing events across all partitions for a given Event Hub and in the context of a specific Consumer Group. This early preview is intended to allow consumers to test the new design using a single instance that does not persist checkpoints to any durable store.
Exceptions
-
Created an exception hierarchy that incorporates the exceptions exposed by the legacy client library, covering the same set of scenarios with minor changes to naming to better clarify the context.
-
Ensured that custom Event Hubs exceptions are properly translated to the new versions, no longer exposing legacy exception types.
Retries and timeouts
-
Removed the exposed retry policies in favor of a set of retry options based on the options found in
Azure.Core
in order to keep the API familiar. -
An abstract
EventHubsRetryPolicy
has been created to serve as the contract for custom retry policy implementations. -
An option for fixed retry has been added to accompany the exponential retry that was in place previously.
Operation timeouts have been moved from the associated client options and incorporated into the retry options and retry policies.