From 96b86c9e8b6c701a01bdd60e7f869bfbb280c0cd Mon Sep 17 00:00:00 2001 From: Kieran Brantner-Magee Date: Wed, 22 Apr 2020 09:41:23 -0700 Subject: [PATCH 1/3] With retry options available, send should no longer require its own timeout. Removes the parameter from sync and async clients. --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 1 + .../azure-servicebus/azure/servicebus/_servicebus_sender.py | 4 +--- .../azure/servicebus/aio/_servicebus_sender_async.py | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 6e97c6a359b0..21635b94d6d8 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -14,6 +14,7 @@ **Breaking Changes** * Session receivers are now created via their own top level functions, e.g. `get_queue_sesison_receiver` and `get_subscription_session_receiver`. Non session receivers no longer take session_id as a paramter. +* `Send()` no longer takes a timeout parameter, as it should be redundant with retry options provided when creating the client. ## 7.0.0b1 (2020-04-06) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_sender.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_sender.py index 00b506101128..ef9c2f1cce82 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_sender.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_servicebus_sender.py @@ -290,13 +290,12 @@ def from_connection_string( ) return cls(**constructor_args) - def send(self, message, timeout=None): + def send(self, message): # type: (Union[Message, BatchMessage], float) -> None """Sends message and blocks until acknowledgement is received or operation times out. :param message: The ServiceBus message to be sent. :type message: ~azure.servicebus.Message - :param float timeout: The maximum wait time to send the event data. :rtype: None :raises: ~azure.servicebus.common.errors.MessageSendFailed if the message fails to send or ~azure.servicebus.common.errors.OperationTimeoutError if sending times out. @@ -314,7 +313,6 @@ def send(self, message, timeout=None): self._do_retryable_operation( self._send, message=message, - timeout=timeout, require_timeout=True, require_last_exception=True ) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py index 6ad5e1c28cf6..601441175a36 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py @@ -238,13 +238,12 @@ def from_connection_string( ) return cls(**constructor_args) - async def send(self, message, timeout=None): + async def send(self, message): # type: (Message, float) -> None """Sends message and blocks until acknowledgement is received or operation times out. :param message: The ServiceBus message to be sent. :type message: ~azure.servicebus.Message - :param float timeout: The maximum wait time to send the event data. :rtype: None :raises: ~azure.servicebus.common.errors.MessageSendFailed if the message fails to send or ~azure.servicebus.common.errors.OperationTimeoutError if sending times out. @@ -262,7 +261,6 @@ async def send(self, message, timeout=None): await self._do_retryable_operation( self._send, message=message, - timeout=timeout, require_timeout=True, require_last_exception=True ) From ffc7398a8919cc412c75d2116658a072a33a922d Mon Sep 17 00:00:00 2001 From: KieranBrantnerMagee Date: Thu, 23 Apr 2020 10:24:06 -0700 Subject: [PATCH 2/3] Specify send method more precisely in changelog --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 21635b94d6d8..166ca9ffa00d 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -14,7 +14,7 @@ **Breaking Changes** * Session receivers are now created via their own top level functions, e.g. `get_queue_sesison_receiver` and `get_subscription_session_receiver`. Non session receivers no longer take session_id as a paramter. -* `Send()` no longer takes a timeout parameter, as it should be redundant with retry options provided when creating the client. +* `ServiceBusSender.Send()` no longer takes a timeout parameter, as it should be redundant with retry options provided when creating the client. ## 7.0.0b1 (2020-04-06) From f81beb3cd09e7c8ec61547c22fce34ba597a703e Mon Sep 17 00:00:00 2001 From: KieranBrantnerMagee Date: Thu, 23 Apr 2020 10:27:44 -0700 Subject: [PATCH 3/3] Fix changelog method capitalization --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 166ca9ffa00d..d94efd5680a8 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -14,7 +14,7 @@ **Breaking Changes** * Session receivers are now created via their own top level functions, e.g. `get_queue_sesison_receiver` and `get_subscription_session_receiver`. Non session receivers no longer take session_id as a paramter. -* `ServiceBusSender.Send()` no longer takes a timeout parameter, as it should be redundant with retry options provided when creating the client. +* `ServiceBusSender.send()` no longer takes a timeout parameter, as it should be redundant with retry options provided when creating the client. ## 7.0.0b1 (2020-04-06)