Skip to content

Commit

Permalink
[ServiceBus] Doc and sample fix (#13013)
Browse files Browse the repository at this point in the history
* doc and sample fix

* typo fix
  • Loading branch information
yunhaoling authored Aug 12, 2020
1 parent 0a5ecf6 commit 7863644
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

* Added new properties to Message, PeekMessage and ReceivedMessage: `content_type`, `correlation_id`, `label`,
`message_id`, `reply_to`, `reply_to_session_id` and `to`. Please refer to the docstring for further information.
* Added new properties to PeekedMessaged and ReceivedMessage: `enqueued_sequence_number`, `dead_letter_error_description`,
* Added new properties to PeekMessage and ReceivedMessage: `enqueued_sequence_number`, `dead_letter_error_description`,
`dead_letter_reason`, `dead_letter_source`, `delivery_count` and `expires_at_utc`. Please refer to the docstring for further information.
* Added support for sending received messages via `ServiceBusSender.send_messages`.
* Added `on_lock_renew_failure` as a parameter to `AutoLockRenew.register`, taking a callback for when the lock is lost non-intentially (e.g. not via settling, shutdown, or autolockrenew duration completion).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
async def message_processing(servicebus_client, queue_name):
while True:
try:
async with servicebus_client.get_queue_session_receiver(queue_name, idle_timeout=1) as receiver:
async with servicebus_client.get_queue_session_receiver(queue_name, max_wait_time=1) as receiver:
renewer = AutoLockRenew()
renewer.register(receiver.session)
await receiver.session.set_session_state("OPEN")
Expand All @@ -38,7 +38,7 @@ async def message_processing(servicebus_client, queue_name):
if str(message) == 'shutdown':
await receiver.session.set_session_state("CLOSED")
break
await renewer.shutdown()
await renewer.close()
except NoActiveSession:
print("There are no non-empty sessions remaining; exiting. This may present as a UserError in the azure portal.")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def message_processing(sb_client, queue_name, messages):
message.complete()
if str(message) == 'shutdown':
receiver.session.set_session_state("CLOSED")
renewer.shutdown()
renewer.close()
except NoActiveSession:
print("There are no non-empty sessions remaining; exiting. This may present as a UserError in the azure portal.")
return
Expand Down

0 comments on commit 7863644

Please sign in to comment.