Skip to content

Commit

Permalink
Servicebus - Track2 - Remove timeout from Send (#11002)
Browse files Browse the repository at this point in the history
* With retry options available, send should no longer require its own timeout.  Removes the parameter from sync and async clients, adds a note to changelog about the delta.
  • Loading branch information
KieranBrantnerMagee authored Apr 24, 2020
1 parent ace5cc1 commit d26c102
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* `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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
)
Expand Down

0 comments on commit d26c102

Please sign in to comment.