diff --git a/sdk/eventhub/azure-eventhub/CHANGELOG.md b/sdk/eventhub/azure-eventhub/CHANGELOG.md index cac523ae87c4..074dce45a938 100644 --- a/sdk/eventhub/azure-eventhub/CHANGELOG.md +++ b/sdk/eventhub/azure-eventhub/CHANGELOG.md @@ -21,6 +21,7 @@ - Fixed a bug where service errors were incorrectly required and expected to have info/description fields. - Fixed a bug so that the BufferedProducer ThreadPoolExecutor uses one worker per partition. ([#38961](https://github.com/Azure/azure-sdk-for-python/issues/38961)) +- Fixed a bug in the EventHub client where the maximum message size negotiation during the AMQP attach frame was handled incorrectly. The client now correctly sends a max message size of 0 (unlimited), allowing the server to apply its internal limit (20 MB) as intended. ### Other Changes diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py index 610c3f188418..657c9bd8a879 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py @@ -46,6 +46,7 @@ OUTGOING_WINDOW, DEFAULT_AUTH_TIMEOUT, MESSAGE_DELIVERY_DONE_STATES, + LINK_MAX_MESSAGE_SIZE ) from .management_operation import ManagementOperation @@ -576,7 +577,7 @@ class SendClient(AMQPClient): def __init__(self, hostname, target, **kwargs): self.target = target # Sender and Link settings - self._max_message_size = kwargs.pop("max_message_size", MAX_FRAME_SIZE_BYTES) + self._max_message_size = kwargs.pop("max_message_size", LINK_MAX_MESSAGE_SIZE) self._link_properties = kwargs.pop("link_properties", None) self._link_credit = kwargs.pop("link_credit", None) super(SendClient, self).__init__(hostname, **kwargs) diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/constants.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/constants.py index 4dad80445f06..ea6e84c161e3 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/constants.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/constants.py @@ -59,6 +59,7 @@ #: size until they have agreed a definitive maximum frame size for that Connection. MIN_MAX_FRAME_SIZE = 512 MAX_FRAME_SIZE_BYTES = 1024 * 1024 +LINK_MAX_MESSAGE_SIZE = 0 MAX_CHANNELS = 65535 INCOMING_WINDOW = 64 * 1024 OUTGOING_WINDOW = 64 * 1024