Breaking changes
- All exceptions should now be imported from
azure.eventhub.exceptions
. - Introduced separate
EventHubSharedKeyCredential
objects for synchronous and asynchronous operations. For async, import the credentials object from theazure.eventhub.aio
namespace. EventData
- Renamed property
application_properties
toproperties
. EventData
no longer has attributelast_enqueued_event_properties
- use this onPartitionContext
instead.
- Renamed property
EvenDataBatch
EventDataBatch.try_add
has been renamed toEventDataBatch.add
.- Renamed property
size
tosize_in_bytes
. - Renamed attribute
max_size
tomax_size_in_bytes
.
EventHubConsumerClient
andEventHubProducerClient
- Renamed method
get_properties
toget_eventhub_properties
. - Renamed parameters in constructor:
host
tofully_qualified_namespace
,event_hub_path
toeventhub_name
. - Renamed parameters in
get_partition_properties
:partition
topartition_id
. - Renamed parameter
consumer_group_name
toconsumer_group
and moved that parameter fromreceive
method to the constructor ofEventHubConsumerClient
. - Renamed parameter
initial_event_position
tostarting_position
on thereceive
method ofEventHubConsumerClient
. - Renamed parameter
event_hub_path
toeventhub_name
in constructor andfrom_connection_string
method of the client object. EventHubProducerClient.send
has been renamed tosend_batch
which will only acceptEventDataBatch
object as input.EventHubProducerClient.create_batch
now also takes thepartition_id
andpartition_key
as optional parameters (which are no longer specified at send).
- Renamed method
- Renamed module
PartitionManager
toCheckpointStore
. - Receive event callback parameter has been renamed to
on_event
and now operates on a single event rather than a list of events. - Removed class
EventPostition
.- The
starting_position
parameter of thereceive
method accepts offset(str
), sequence number(int
), datetime (datetime.datetime
) ordict
of these types. - The
starting_position_inclusive
parameter of thereceive
method acceptsbool
ordict
indicating whether the given event position is inclusive or not.
- The
PartitionContext
no longer has attributeowner_id
.PartitionContext
now has attributelast_enqueued_event_properties
which is populated iftrack_last_enqueued_event_properties
is set toTrue
in thereceive
method.
** New features **
- Added new parameter
idle_timeout
in construct andfrom_connection_string
toEventHubConsumerClient
andEventHubProducerClient
after which the underlying connection will close if there is no further activity.
Breaking changes
EventHubClient
,EventHubConsumer
andEventHubProducer
has been removed. UseEventHubProducerClient
andEventHubConsumerClient
instead.- Construction of both objects is the same as it was for the previous client.
- Introduced
EventHubProducerClient
as substitution forEventHubProducer
.EventHubProducerClient
supports sending events to different partitions.
- Introduced
EventHubConsumerClient
as substitution forEventHubConsumer
.EventHubConsumerClient
supports receiving events from single/all partitions.- There are no longer methods which directly return
EventData
, all receiving is done via callback method:on_events
.
EventHubConsumerClient
has taken on the responsibility ofEventProcessor
.EventHubConsumerClient
now acceptsPartitionManager
to do load-balancing and checkpoint.
- Replaced
PartitionProcessor
by four independent callback methods accepted by thereceive
method onEventHubConsumerClient
.on_events(partition_context, events)
called when events are received.on_error(partition_context, exception
called when errors occur.on_partition_initialize(partition_context)
called when a partition consumer is opened.on_partition_close(partition_context, reason)
called when a partition consumer is closed.
- Some modules and classes that were importable from several different places have been removed:
azure.eventhub.common
has been removed. Import fromazure.eventhub
instead.azure.eventhub.client_abstract
has been removed. Useazure.eventhub.EventHubProducerClient
orazure.eventhub.EventHubConsumerClient
instead.azure.eventhub.client
has been removed. Useazure.eventhub.EventHubProducerClient
orazure.eventhub.EventHubConsumerClient
instead.azure.eventhub.producer
has been removed. Useazure.eventhub.EventHubProducerClient
instead.azure.eventhub.consumer
has been removed. Useazure.eventhub.EventHubConsumerClient
instead.azure.eventhub.aio.client_async
has been removed. Useazure.eventhub.aio.EventHubProducerClient
orazure.eventhub.aio.EventHubConsumerClient
instead.azure.eventhub.aio.producer_async
has been removed. Useazure.eventhub.aio.EventHubProducerClient
instead.azure.eventhub.aio.consumer_async
has been removed. Useazure.eventhub.aio.EventHubConsumerClient
instead.azure.eventhub.aio.event_processor.event_processor
has been removed. Useazure.eventhub.aio.EventHubConsumerClient
instead.azure.eventhub.aio.event_processor.partition_processor
has been removed. Use callback methods instead.azure.eventhub.aio.event_processor.partition_manager
has been removed. Import fromazure.eventhub.aio
instead.azure.eventhub.aio.event_processor.partition_context
has been removed. Import fromazure.eventhub.aio
instead.azure.eventhub.aio.event_processor.sample_partition_manager
has been removed.
Bug fixes
- Fixed bug in user-agent string not being parsed.
New features
- Added support for tracing (issue #7153).
- Added the capability of tracking last enqueued event properties of the partition to
EventHubConsumer
.- Added new boolean type parameter
track_last_enqueued_event_properties
in methodEventHubClient.create_consumer()
. - Added new property
last_enqueued_event_properties
ofEventHubConsumer
which contains sequence_number, offset, enqueued_time and retrieval_time information. - By default the capability is disabled as it will cost extra bandwidth for transferring more information if turned on.
- Added new boolean type parameter
Breaking changes
- Removed support for IoT Hub direct connection.
- EventHubs compatible connection string of an IotHub can be used to create
EventHubClient
and read properties or events from an IoT Hub.
- EventHubs compatible connection string of an IotHub can be used to create
- Removed support for sending EventData to IoT Hub.
- Removed parameter
exception
in methodclose()
ofEventHubConsumer
andEventHubProcuer
. - Updated uAMQP dependency to 1.2.3.
New features
- Added support for automatic load balancing among multiple
EventProcessor
. - Added
BlobPartitionManager
which implementsPartitionManager
.- Azure Blob Storage is applied for storing data used by
EventProcessor
. - Packaged separately as a plug-in to
EventProcessor
. - For details, please refer to Azure Blob Storage Partition Manager.
- Azure Blob Storage is applied for storing data used by
- Added property
system_properties
onEventData
.
Breaking changes
- Removed constructor method of
PartitionProcessor
. For initialization please implement the methodinitialize
. - Replaced
CheckpointManager
byPartitionContext
.PartitionContext
has partition context information and methodupdate_checkpoint
.
- Updated all methods of
PartitionProcessor
to includePartitionContext
as part of the arguments. - Updated accessibility of class members in
EventHub/EventHubConsumer/EventHubProducer
to be private. - Moved
azure.eventhub.eventprocessor
underaio
package, which now becomesazure.eventhub.aio.eventprocessor
.
New features
- Added method
create_batch
on theEventHubProducer
to create anEventDataBatch
that can then be used to add events until the maximum size is reached.- This batch object can then be used in the
send()
method to send all the added events to Event Hubs. - This allows publishers to build batches without the possibility of encountering the error around the message size exceeding the supported limit when sending events.
- It also allows publishers with bandwidth concerns to control the size of each batch published.
- This batch object can then be used in the
- Added new configuration parameters for exponential delay between retry operations.
retry_total
: The total number of attempts to redo the failed operation.backoff_factor
: The delay time factor.backoff_max
: The maximum delay time in total.
- Added support for context manager on
EventHubClient
. - Added new error type
OperationTimeoutError
for send operation. - Introduced a new class
EventProcessor
which replaces the older concept of Event Processor Host. This early preview is intended to allow users to test the new design using a single instance ofEventProcessor
. The ability to checkpoints to a durable store will be added in future updates.EventProcessor
: EventProcessor creates and runs consumers for all partitions of the eventhub.PartitionManager
: PartitionManager defines the interface for getting/claiming ownerships of partitions and updating checkpoints.PartitionProcessor
: PartitionProcessor defines the interface for processing events.CheckpointManager
: CheckpointManager takes responsibility for updating checkpoints during events processing.
Breaking changes
EventProcessorHost
was replaced byEventProcessor
, please read the new features for details.- Replaced
max_retries
configuration parameter of the EventHubClient withretry_total
.
Version 5.0.0b1 is a preview of our efforts to create a client library that is user friendly and idiomatic to the Python ecosystem. The reasons for most of the changes in this update can be found in the Azure SDK Design Guidelines for Python. For more information, please visit https://aka.ms/azure-sdk-preview1-python.
New features
- Added new configuration parameters for creating EventHubClient.
credential
: The credential object used for authentication which implementsTokenCredential
interface of getting tokens.transport_type
: The type of transport protocol that will be used for communicating with the Event Hubs service.max_retries
: The max number of attempts to redo the failed operation when an error happened.- for detailed information about the configuration parameters, please read the reference documentation.
- Added new methods
get_partition_properties
andget_partition_ids
to EventHubClient. - Added support for http proxy.
- Added support for authentication using azure-identity credential.
- Added support for transport using AMQP over WebSocket.
Breaking changes
- New error hierarchy
azure.error.EventHubError
azure.error.ConnectionLostError
azure.error.ConnectError
azure.error.AuthenticationError
azure.error.EventDataError
azure.error.EventDataSendError
- Renamed Sender/Receiver to EventHubProducer/EventHubConsumer.
- Renamed
add_sender
tocreate_producer
andadd_receiver
tocreate_consumer
in EventHubClient. - EventHubConsumer is now iterable.
- Renamed
- Rename class azure.eventhub.Offset to azure.eventhub.EventPosition.
- Rename method
get_eventhub_info
toget_properties
of EventHubClient. - Reorganized connection management, EventHubClient is no longer responsible for opening/closing EventHubProducer/EventHubConsumer.
- Each EventHubProducer/EventHubConsumer is responsible for its own connection management.
- Added support for context manager on EventHubProducer and EventHubConsumer.
- Reorganized async APIs into "azure.eventhub.aio" namespace and rename to drop the "_async" suffix.
- Updated uAMQP dependency to 1.2.
BugFixes
- Fixed bug where datetime offset filter was using a local timestamp rather than UTC.
- Fixed stackoverflow error in continuous connection reconnect attempts.
BugFixes
- Added support for auto reconnect on token expiration and other auth errors (issue #89).
Features
- Added ability to create ServiceBusClient from an existing SAS auth token, including providing a function to auto-renew that token on expiry.
- Added support for storing a custom EPH context value in checkpoint (PR #84, thanks @konstantinmiller)
- Support for Python 2.7 in azure.eventhub module (azure.eventprocessorhost will not support Python 2.7).
- Parse EventData.enqueued_time as a UTC timestamp (issue #72, thanks @vjrantal)
- Fixed bug in Azure namespace package.
-
Changes to
AzureStorageCheckpointLeaseManager
parameters to support other connection options (issue #61):- The
storage_account_name
,storage_account_key
andlease_container_name
arguments are now optional keyword arguments. - Added a
sas_token
argument that must be specified withstorage_account_name
in place ofstorage_account_key
. - Added an
endpoint_suffix
argument to support storage endpoints in National Clouds. - Added a
connection_string
argument that, if specified, overrides all other endpoint arguments. - The
lease_container_name
argument now defaults to"eph-leases"
if not specified.
- The
-
Fix for clients failing to start if run called multipled times (issue #64).
-
Added convenience methods
body_as_str
andbody_as_json
to EventData object for easier processing of message data.
- API stable.
- Renamed internal
_async
module toasync_ops
for docs generation. - Added optional
auth_timeout
parameter toEventHubClient
andEventHubClientAsync
to configure how long to allow for token negotiation to complete. Default is 60 seconds. - Added optional
send_timeout
parameter toEventHubClient.add_sender
andEventHubClientAsync.add_async_sender
to determine the timeout for Events to be successfully sent. Default value is 60 seconds. - Reformatted logging for performance.
-
Stability improvements for EPH.
-
Updated uAMQP version.
-
Added new configuration options for Sender and Receiver;
keep_alive
andauto_reconnect
. These flags have been added to the following:EventHubClient.add_receiver
EventHubClient.add_sender
EventHubClientAsync.add_async_receiver
EventHubClientAsync.add_async_sender
EPHOptions.keey_alive_interval
EPHOptions.auto_reconnect_on_error
- Breaking change
EventData.offset
will now return an object of type~uamqp.common.Offset
rather than str. The original string value can be retrieved from~uamqp.common.Offset.value
. - Each sender/receiver will now run in its own independent connection.
- Updated uAMQP dependency to 0.2.0
- Fixed issue with IoTHub clients not being able to retrieve partition information.
- Added support for HTTP proxy settings to both EventHubClient and EPH.
- Added error handling policy to automatically reconnect on retryable error.
- Added keep-alive thread for maintaining an unused connection.
- Breaking change Restructured library to support Python 3.7. Submodule
async
has been renamed and all classes from this module can now be imported from azure.eventhub directly. - Breaking change Removed optional
callback
argument fromReceiver.receive
andAsyncReceiver.receive
. - Breaking change
EventData.properties
has been renamed toEventData.application_properties
. This removes the potential for messages to be processed via callback for not yet returned in the batch. - Updated uAMQP dependency to v0.1.0
- Added support for constructing IoTHub connections.
- Fixed memory leak in receive operations.
- Dropped Python 2.7 wheel support.
- Added
namespace_suffix
to EventHubConfig() to support national clouds. - Added
device_id
attribute to EventData to support IoT Hub use cases. - Added message header to workaround service bug for PartitionKey support.
- Updated uAMQP dependency to vRC1.
- Updated uAMQP to latest version.
- Further testing and minor bug fixes.
- Updated uAQMP dependency.
- Swapped out Proton dependency for uAMQP.