- Updated network trace logging to replace
Nonevalues in AMQP connection info with empty strings as per the OpenTelemetry specification.
This version and all future versions will require Python 3.8+. Python 3.7 is no longer supported.
- Added
keep_alivefunctionality on EventHubProducerClient to allow for long-living producers. #33726
- Added support for Python 3.12.
- Fixed a pyAMQP error where events split across multiple TransferFrames were depleting the link credit by more than 1 credit per message. (#32767)
- A new float keyword argument
socket_timeouthas been added to the sync and asyncEventHubConsumerClientandEventHubProducerClient.
- Fixed bug #31258 where async
BlobCheckpointStorewas reprocessing old events after an error.
- Fixed the error
end frame received on invalid channelwhich was raised when a disconnect was sent by the service (#30860) - Fixed the error
link already closedwhich was raised when the client was closing and disconnecting from the service (#30836)
- Updated tracing (#29934):
- Span names renamed:
Azure.EventHubs.sendtoEventHubs.sendAzure.EventHubs.messagetoEventHubs.messageAzure.EventHubs.processtoEventHubs.process
- An
EventHubs.receivespan will be created upon receiving events. - Additional attributes added to spans:
messaging.system- messaging system (i.e.,eventhubs)messaging.operation- type of operation (i.e.,publish,receive, orprocess)messaging.batch.message_count- number of messages sent, received, or processed (if more than one)
- The
componentattribute was removed from all spans. - All
sendspans now contain links tomessagespans. Now,messagespans will no longer contain a link to thesendspan. - Message application properties will now contain values for
traceparent(andtracestateif applicable) - Process spans will now be a direct children of message span contexts in when event handling on a per-message basis. (#30537)
- Span names renamed:
- Fixed a bug that would prevent reconnect after a long idle period, network drop (issue #28996)
- Fixed a bug where, when
websocket-clientwas not installed, the error was not caught/raised properly (issue #28453).
Version 5.11.0 is our first stable release of the Azure Event Hubs client library based on a pure Python implemented AMQP stack.
- A new boolean keyword argument
uamqp_transporthas been added to sync and asyncEventHubProducerClient/EventHubConsumerClientconstructors which indicates whether to use theuamqplibrary or the default pure Python AMQP library as the underlying transport.
- Fixed a bug that caused an error when sending batches with tracing enabled (issue #27986).
- Fixed a bug where
EventHubSharedKeyCredentialreturned anAccessToken.tokenof typebytesand notstr, now matching the documentation.
- The
messageattribute onEventData/EventDataBatch, which previously exposed theuamqp.Message, has been deprecated.LegacyMessage/LegacyBatchMessageobjects returned by themessageattribute onEventData/EventDataBatchhave been introduced to help facilitate the transition.
- Removed uAMQP from required dependencies.
- Adding
uamqp >= 1.6.3as an optional dependency for use with theuamqp_transportkeyword.- Added support for Python 3.11.
- Updated the optional dependency for async transport using AMQP over WebSocket from
websocket-clienttoaiohttp(Issue #24315, thanks @hansmbakker for the suggestion).
This version and all future versions will require Python 3.7+. Python 3.6 is no longer supported.
- Added the
uamqp_transportoptional parameter to the clients, to allow switching to theuamqplibrary as the transport.
This version and all future versions will require Python 3.7+, Python 3.6 is no longer supported.
- Fixed a bug in async
BufferedProducerthat would block when flushing the queue causing the client to freeze up (issue #23510). - Fixed a bug in the async
EventHubProducerClientandEventHubConsumerClientthat set the default value of thetransport_typeparameter in thefrom_connection_stringmethods toNonerather thanTransportType.Amqp.
- Internal refactoring to support upcoming Pure Python AMQP-based release.
- Updated uAMQP dependency to 1.6.0.
- Fixed bug that prevented token refresh at regular intervals.
- Fixed bug that was improperly passing the debug keyword argument, so that network trace debug logs are output when requested.
- Added logging added in to track proper token refreshes & fetches, output exception reason for producer init failure.
- Includes the following features related to buffered sending of events:
- A new method
send_eventtoEventHubProducerClientwhich allows sending singleEventDataorAmqpAnnotatedMessage. - Buffered mode sending to
EventHubProducerClientwhich is intended to allow for efficient publishing of events without having to explicitly manage batches in the application.- The constructor of
EventHubProducerClientandfrom_connection_stringmethod takes the following new keyword arguments for configuration:buffered_mode: The flag to enable/disable buffered mode sending.on_success: The callback to be called once events have been successfully published.on_error: The callback to be called once events have failed to be published.max_buffer_length: The total number of events per partition that can be buffered before a flush will be triggered.max_wait_time: The amount of time to wait for a batch to be built with events in the buffer before publishing.
- A new method
EventHubProducerClient.flushwhich flushes events in the buffer to be sent immediately. - A new method
EventHubProducerClient.get_buffered_event_countwhich returns the number of events that are buffered and waiting to be published for a given partition. - A new property
EventHubProducerClient.total_buffered_event_countwhich returns the total number of events that are currently buffered and waiting to be published, across all partitions. - A new boolean keyword argument
flushtoEventHubProducerClient.closewhich indicates whether to flush the buffer or not while closing.
- The constructor of
- A new method
- Added support for connection using websocket and http proxy.
- Added support for custom endpoint connection over websocket.
- The classmethod
from_message_contenthas been added toEventDatafor interoperability with the Schema Registry Avro Encoder library, and takescontentandcontent_typeas positional parameters.
- Features related to buffered sending of events are still in beta and will not be included in this release.
- Introduced new method
send_eventtoEventHubProducerClientwhich allows sending singleEventDataorAmqpAnnotatedMessage. - Introduced buffered mode sending to
EventHubProducerClientwhich is intended to allow for efficient publishing of events without having to explicitly manage batches in the application.- The constructor of
EventHubProducerClientandfrom_connection_stringmethod now takes the following new keyword arguments for configuration:buffered_mode: The flag to enable/disable buffered mode sending.on_success: The callback to be called once events have been successfully published.on_error: The callback to be called once events have failed to be published.max_buffer_length: The total number of events per partition that can be buffered before a flush will be triggered.max_wait_time: The amount of time to wait for a batch to be built with events in the buffer before publishing.
- Introduced new method
EventHubProducerClient.flushwhich flushes events in the buffer to be sent immediately. - Introduced new method
EventHubProducerClient.get_buffered_event_countwhich returns the number of events that are buffered and waiting to be published for a given partition. - Introduced new property
EventHubProducerClient.total_buffered_event_countwhich returns the total number of events that are currently buffered and waiting to be published, across all partitions. - Introduced new boolean keyword argument
flushtoEventHubProducerClient.closewhich indicates whether to flush the buffer or not while closing.
- The constructor of
- Updated
EventDatainternals for interoperability with the Schema Registry Avro Encoder library.
from_message_dataonEventDatahas been renamedfrom_message_contentfor interoperability with the Schema Registry Avro Encoder library. Thedataparameter has been renamed tocontent.
- Improved the performance of async sending and receiving.
- The following features have been temporarily pulled out of async
EventHubProducerClientandEventHubConsumerClientwhich will be added back in future previews as we work towards a stable release:- Passing the following keyword arguments to the constructors and
from_connection_stringmethods of theEventHubProducerClientandEventHubConsumerClientis not supported:transport_type,http_proxy,custom_endpoint_address, andconnection_verify.
- Passing the following keyword arguments to the constructors and
- Added support for async
EventHubProducerClientandEventHubConsumerClient.
Version 5.8.0a1 is our first efforts to build an Azure Event Hubs client library based on pure python implemented AMQP stack.
- The following features have been temporarily pulled out which will be added back in future previews as we work towards a stable release:
- Async is not supported.
- Passing the following keyword arguments to the constructors and
from_connection_stringmethods of theEventHubProducerClientandEventHubConsumerClientis not supported:transport_type,http_proxy,custom_endpoint_address, andconnection_verify.
- uAMQP dependency is removed.
This version and all future versions will require Python 3.6+. Python 2.7 is no longer supported.
- Added support for fixed (linear) retry backoff:
- Sync/async
EventHubProducerClientandEventHubConsumerClientconstructors andfrom_connection_stringtakeretry_modeas a keyword argument.
- Sync/async
- Fixed a bug that
EventHubProducerClientcould be reopened for sending events instead of encountering withKeyErrorwhen the client is previously closed (issue #21849).
- Improved token refresh timing to prevent potentially blocking main flow when the token is about to get expired soon.
- Updated uAMQP dependency to 1.5.1.
- Fixed a bug for checking that
azure.eventhub.amqp.AmqpMessageHeaderandazure.eventhub.amqp.AmqpMessagePropertiescontain specific properties using theinkeyword.
- Updated uAMQP dependency to 1.4.3.
- Added support for Python 3.10.
- Fixed memory leak in win32 socketio and tlsio (issue #19777).
- Fixed memory leak in the process of converting AMQPValue into string (issue #19777).
- Added support for sending AMQP annotated message which allows full access to the AMQP message fields.
- Introduced new namespace
azure.eventhub.amqp. - Added new enum class
azure.eventhub.amqp.AmqpMessageBodyTypeto represent the body type of the message which includes:DATA: The body of message consists of one or more data sections and each section contains opaque binary data.SEQUENCE: The body of message consists of one or more sequence sections and each section contains an arbitrary number of structured data elements.VALUE: The body of message consists of one amqp-value section and the section contains a single AMQP value.
- Introduced new class
azure.eventhub.amqp.AmqpAnnotatedMessagefor accessing low-level amqp message sections which can be instantiated for sending. - Introduced new classes
azure.eventhub.amqp.AmqpMessageHeaderandazure.eventhub.amqp.AmqpMessagePropertiesfor accessing amqp header and properties. - Added new property
body_typeonazure.eventhub.EventDatawhich returnsazure.eventhub.amqp.AmqpMessageBodyType. - Added new read-only property
raw_amqp_messageonazure.eventhub.EventDatawhich returnsazure.eventhub.amqp.AmqpAnnotatedMessage.
- Introduced new namespace
- Updated uAMQP dependency to 1.4.1.
- Fixed a bug that attributes creation_time, absolute_expiry_time and group_sequence on MessageProperties should be compatible with integer types on Python 2.7.
New Features
- Added support for using
azure.core.credentials.AzureNamedKeyCredentialas credential for authenticating producer and consumer clients.
Bug Fixes
- Fixed bug that custom user agent string should be put in front of the built-in user agent string instead of being appended.
- Updated uAMQP dependency to 1.4.0.
- Fixed memory leaks in the process of link attach where source and target cython objects are not properly deallocated (#15747).
- Improved management operation callback not to parse description value of non AMQP_TYPE_STRING type as string (#18361).
Notes
- Updated azure-core dependency to 1.14.0.
This version follows from version 5.3.1, rather than 5.4.0b1 so that the preview idempotent producer feature is not included.
New Features
- Added support for using
azure.core.credentials.AzureSasCredentialas credential for authenticating producer and consumer clients. - Updated
list_ownership,claim_ownership,update_checkpoint,list_checkpointson sync and asyncCheckpointStoreto support taking**kwargs.- WARNING: Implementing a custom checkpointstore that does not support taking
**kwargsin the methods listed previously will result in the following pylint error:W0221: Parameters differ from overridden ________ method (arguments-differ).
- WARNING: Implementing a custom checkpointstore that does not support taking
- Updated
update_checkpointon sync and asyncPartitionContextto support taking**kwargs.
Bug Fixes
- Updated uAMQP dependency to 1.3.0.
- Fixed bug that sending message of large size triggering segmentation fault when the underlying socket connection is lost (#13739, #14543).
- Fixed bug in link flow control where link credit and delivery count should be calculated based on per message instead of per transfer frame (#16934).
Notes
- Updated azure-core dependency to 1.13.0.
This version and all future versions will require Python 2.7 or Python 3.6+, Python 3.5 is no longer supported.
New Features
- Added support for idempotent publishing which is supported by the service to endeavor to reduce the number of duplicate
events that are published.
EventHubProducerClientconstructor accepts two new parameters for idempotent publishing:enable_idempotent_partitions: A boolean value to tell theEventHubProducerClientwhether to enable idempotency.partition_config: The set of configurations that can be specified to influence publishing behavior specific to the configured Event Hub partition.
- Introduced a new method
get_partition_publishing_propertiesonEventHubProducerClientto inspect the information about the state of publishing for a partition. - Introduced a new property
published_sequence_numberonEventDatato get the publishing sequence number assigned to the event at the time it was successfully published. - Introduced a new property
starting_published_sequence_numberonEventDataBatchto get the publishing sequence number assigned to the first event in the batch at the time the batch was successfully published. - Introduced a new class
azure.eventhub.PartitionPublishingConfigurationwhich is a set of configurations that can be specified to influence the behavior when publishing directly to an Event Hub partition.
Notes
- Updated uAMQP dependency to 1.2.15.
This version will be the last version to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.
Bug fixes
- Sending empty
event_data_batchwill be a no-op now instead of raising error.
New Features
- Added a
parse_connection_stringmethod which parses a connection string into a properties bag,EventHubConnectionStringProperties, containing its component parts. - The constructor and
from_connection_stringmethod ofEventHubConsumerClientandEventHubProducerClientnow accept two new optional arguments:custom_endpoint_addresswhich allows for specifying a custom endpoint to use when communicating with the Event Hubs service, and is useful when your network does not allow communicating to the standard Event Hubs endpoint.connection_verifywhich allows for specifying the path to the custom CA_BUNDLE file of the SSL certificate which is used to authenticate the identity of the connection endpoint.
Notes
- Updated uAMQP dependency to 1.2.14.
Bug fixes
- Updated
azure.eventhub.extension.__init__.pyto be compatible with pkgutil-style namespace (PR #13210, thanks @pjachowi). - Updated uAMQP dependency to 1.2.13
- Added support for Python 3.9.
- Fixed bug that macOS was unable to detect network error (#15473).
- Fixed bug that
uamqp.ReceiveClientanduamqp.ReceiveClientAsyncreceive messages during connection establishment (#15555). - Fixed bug where connection establishment on macOS with Clang 12 triggering unrecognized selector exception (#15567).
- Fixed bug in accessing message properties triggering segmentation fault when the underlying C bytes are NULL (#15568).
New Features
- Connection strings used with
from_connection_stringmethods now supports using theSharedAccessSignaturekey in leiu ofsharedaccesskeyandsharedaccesskeyname, taking the string of the properly constructed token as value.
New Features
EventHubConsumerClientconstructor accepts two new parameters for the load balancer.load_balancing_strategy, which can be "greedy" or "balanced". With greedy strategy, one execution of load balancing will claim as many partitions as required to balance the load whereas with balanced strategy one execution of load balancing will claim at most 1 partition.partition_ownership_expiration_interval, which allows you to customize the partition ownership expiration for load balancing. A consumer client may lose its owned partitions more often with a smaller expiration interval. But a larger interval may result in idle partitions not being claimed for longer time.
- Added enum class
azure.eventhub.LoadBalancingStrategyforload_balancing_strategy.
New Features
EventHubProducerClient.send_batchaccepts either anEventDataBatchor a finite list ofEventData. #9181- Added enqueueTime to span links of distributed tracing. #9599
Bug fixes
- Fixed a bug that turned
azure.eventhub.EventhubConsumerClientinto an exclusive receiver when it has no checkpoint store. #11181 - Updated uAMQP dependency to 1.2.7.
- Fixed bug in setting certificate of tlsio on MacOS. #7201
- Fixed bug that caused segmentation fault in network tracing on MacOS when setting
logging_enabletoTrueinEventHubConsumerClientandEventHubProducerClient.
New Features
- Added
EventHubConsumerClient.receive_batch()to receive and process events in batches instead of one by one. #9184 EventHubConsumerCliuent.receive()has a new parammax_wait_time.on_eventis called everymax_wait_timewhen no events are received andmax_wait_timeis notNoneor 0.- Param event of
PartitionContext.update_checkpointis now optional. The last received event is used when param event is not passed in. EventData.system_propertieshas added missing properties when consuming messages from IotHub. #10408
Bug fixes
- Fixed a bug that swallowed errors when receiving events with
azure.eventhub.EventHubConsumerClient#9660 - Fixed a bug that caused
get_eventhub_properties,get_partition_ids, andget_partition_propertiesto raise an error on Azure Stack #9920
Breaking changes
EventData- Removed deprecated property
application_propertiesand deprecated methodencode_message().
- Removed deprecated property
EventHubConsumerClienton_errorwould be called whenEventHubConsumerClientfailed to claim ownership of partitions.on_partition_closeandon_partition_initializewould be called in the case of exceptions raised byon_eventcallback.EventHubConsumerClientwould close and re-open the internal partition receiver in this case.
- Default starting position from where
EventHubConsumerClientshould resume receiving after recovering from an error has been re-prioritized.- If there is checkpoint, it will resume from the checkpoint.
- If there is no checkpoint but
starting_positionis provided, it will resume fromstarting_posititon. - If there is no checkpoint or
starting_position, it will resume from the latest position.
PartitionContextupdate_checkpointwould do in-memory checkpoint instead of doing nothing when checkpoint store is not explicitly provided.- The in-memory checkpoints would be used for
EventHubConsumerClientreceiving recovering.
- The in-memory checkpoints would be used for
get_partition_ids,get_partition_properties,get_eventhub_propertieswould raise error in the case of service returning an error status code.AuthenticationErrorwould be raised when service returning error code 401.ConnectErrorwould be raised when service returning error code 404.EventHubErrorwould be raised when service returning other error codes.
Breaking changes
- All exceptions should now be imported from
azure.eventhub.exceptions. - Introduced separate
EventHubSharedKeyCredentialobjects for synchronous and asynchronous operations. For async, import the credentials object from theazure.eventhub.aionamespace. EventData- Renamed property
application_propertiestoproperties. EventDatano longer has attributelast_enqueued_event_properties- use this onPartitionContextinstead.
- Renamed property
EvenDataBatchEventDataBatch.try_addhas been renamed toEventDataBatch.add.- Renamed property
sizetosize_in_bytes. - Renamed attribute
max_sizetomax_size_in_bytes.
EventHubConsumerClientandEventHubProducerClient- Renamed method
get_propertiestoget_eventhub_properties. - Renamed parameters in constructor:
hosttofully_qualified_namespace,event_hub_pathtoeventhub_name. - Renamed parameters in
get_partition_properties:partitiontopartition_id. - Renamed parameter
consumer_group_nametoconsumer_groupand moved that parameter fromreceivemethod to the constructor ofEventHubConsumerClient. - Renamed parameter
initial_event_positiontostarting_positionon thereceivemethod ofEventHubConsumerClient. - Renamed parameter
event_hub_pathtoeventhub_namein constructor andfrom_connection_stringmethod of the client object. EventHubProducerClient.sendhas been renamed tosend_batchwhich will only acceptEventDataBatchobject as input.EventHubProducerClient.create_batchnow also takes thepartition_idandpartition_keyas optional parameters (which are no longer specified at send).
- Renamed method
- Renamed module
PartitionManagertoCheckpointStore. - Receive event callback parameter has been renamed to
on_eventand now operates on a single event rather than a list of events. - Removed class
EventPostition.- The
starting_positionparameter of thereceivemethod accepts offset(str), sequence number(int), datetime (datetime.datetime) ordictof these types. - The
starting_position_inclusiveparameter of thereceivemethod acceptsboolordictindicating whether the given event position is inclusive or not.
- The
PartitionContextno longer has attributeowner_id.PartitionContextnow has attributelast_enqueued_event_propertieswhich is populated iftrack_last_enqueued_event_propertiesis set toTruein thereceivemethod.
New features
- Added new parameter
idle_timeoutin construct andfrom_connection_stringtoEventHubConsumerClientandEventHubProducerClientafter which the underlying connection will close if there is no further activity.
Breaking changes
EventHubClient,EventHubConsumerandEventHubProducerhas been removed. UseEventHubProducerClientandEventHubConsumerClientinstead.- Construction of both objects is the same as it was for the previous client.
- Introduced
EventHubProducerClientas substitution forEventHubProducer.EventHubProducerClientsupports sending events to different partitions.
- Introduced
EventHubConsumerClientas substitution forEventHubConsumer.EventHubConsumerClientsupports receiving events from single/all partitions.- There are no longer methods which directly return
EventData, all receiving is done via callback method:on_events.
EventHubConsumerClienthas taken on the responsibility ofEventProcessor.EventHubConsumerClientnow acceptsPartitionManagerto do load-balancing and checkpoint.
- Replaced
PartitionProcessorby four independent callback methods accepted by thereceivemethod onEventHubConsumerClient.on_events(partition_context, events)called when events are received.on_error(partition_context, exceptioncalled 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.commonhas been removed. Import fromazure.eventhubinstead.azure.eventhub.client_abstracthas been removed. Useazure.eventhub.EventHubProducerClientorazure.eventhub.EventHubConsumerClientinstead.azure.eventhub.clienthas been removed. Useazure.eventhub.EventHubProducerClientorazure.eventhub.EventHubConsumerClientinstead.azure.eventhub.producerhas been removed. Useazure.eventhub.EventHubProducerClientinstead.azure.eventhub.consumerhas been removed. Useazure.eventhub.EventHubConsumerClientinstead.azure.eventhub.aio.client_asynchas been removed. Useazure.eventhub.aio.EventHubProducerClientorazure.eventhub.aio.EventHubConsumerClientinstead.azure.eventhub.aio.producer_asynchas been removed. Useazure.eventhub.aio.EventHubProducerClientinstead.azure.eventhub.aio.consumer_asynchas been removed. Useazure.eventhub.aio.EventHubConsumerClientinstead.azure.eventhub.aio.event_processor.event_processorhas been removed. Useazure.eventhub.aio.EventHubConsumerClientinstead.azure.eventhub.aio.event_processor.partition_processorhas been removed. Use callback methods instead.azure.eventhub.aio.event_processor.partition_managerhas been removed. Import fromazure.eventhub.aioinstead.azure.eventhub.aio.event_processor.partition_contexthas been removed. Import fromazure.eventhub.aioinstead.azure.eventhub.aio.event_processor.sample_partition_managerhas 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_propertiesin methodEventHubClient.create_consumer(). - Added new property
last_enqueued_event_propertiesofEventHubConsumerwhich 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
EventHubClientand 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
exceptionin methodclose()ofEventHubConsumerandEventHubProcuer. - Updated uAMQP dependency to 1.2.3.
New features
- Added support for automatic load balancing among multiple
EventProcessor. - Added
BlobPartitionManagerwhich 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_propertiesonEventData.
Breaking changes
- Removed constructor method of
PartitionProcessor. For initialization please implement the methodinitialize. - Replaced
CheckpointManagerbyPartitionContext.PartitionContexthas partition context information and methodupdate_checkpoint.
- Updated all methods of
PartitionProcessorto includePartitionContextas part of the arguments. - Updated accessibility of class members in
EventHub/EventHubConsumer/EventHubProducerto be private. - Moved
azure.eventhub.eventprocessorunderaiopackage, which now becomesazure.eventhub.aio.eventprocessor.
New features
- Added method
create_batchon theEventHubProducerto create anEventDataBatchthat 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
OperationTimeoutErrorfor send operation. - Introduced a new class
EventProcessorwhich 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
EventProcessorHostwas replaced byEventProcessor, please read the new features for details.- Replaced
max_retriesconfiguration 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 implementsTokenCredentialinterface 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_propertiesandget_partition_idsto 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.EventHubErrorazure.error.ConnectionLostErrorazure.error.ConnectErrorazure.error.AuthenticationErrorazure.error.EventDataErrorazure.error.EventDataSendError
- Renamed Sender/Receiver to EventHubProducer/EventHubConsumer.
- Renamed
add_sendertocreate_producerandadd_receivertocreate_consumerin EventHubClient. - EventHubConsumer is now iterable.
- Renamed
- Rename class azure.eventhub.Offset to azure.eventhub.EventPosition.
- Rename method
get_eventhub_infotoget_propertiesof 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
AzureStorageCheckpointLeaseManagerparameters to support other connection options (issue #61):- The
storage_account_name,storage_account_keyandlease_container_namearguments are now optional keyword arguments. - Added a
sas_tokenargument that must be specified withstorage_account_namein place ofstorage_account_key. - Added an
endpoint_suffixargument to support storage endpoints in National Clouds. - Added a
connection_stringargument that, if specified, overrides all other endpoint arguments. - The
lease_container_nameargument 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_strandbody_as_jsonto EventData object for easier processing of message data.
- API stable.
- Renamed internal
_asyncmodule toasync_opsfor docs generation. - Added optional
auth_timeoutparameter toEventHubClientandEventHubClientAsyncto configure how long to allow for token negotiation to complete. Default is 60 seconds. - Added optional
send_timeoutparameter toEventHubClient.add_senderandEventHubClientAsync.add_async_senderto 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_aliveandauto_reconnect. These flags have been added to the following:EventHubClient.add_receiverEventHubClient.add_senderEventHubClientAsync.add_async_receiverEventHubClientAsync.add_async_senderEPHOptions.keey_alive_intervalEPHOptions.auto_reconnect_on_error
- Breaking change
EventData.offsetwill now return an object of type~uamqp.common.Offsetrather 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
asynchas been renamed and all classes from this module can now be imported from azure.eventhub directly. - Breaking change Removed optional
callbackargument fromReceiver.receiveandAsyncReceiver.receive. - Breaking change
EventData.propertieshas 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_suffixto EventHubConfig() to support national clouds. - Added
device_idattribute 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.