diff --git a/sdk/servicebus/azure-servicebus/samples/async_samples/sample_code_servicebus_async.py b/sdk/servicebus/azure-servicebus/samples/async_samples/sample_code_servicebus_async.py index b4ded73c2eba..e4b9fa76d014 100644 --- a/sdk/servicebus/azure-servicebus/samples/async_samples/sample_code_servicebus_async.py +++ b/sdk/servicebus/azure-servicebus/samples/async_samples/sample_code_servicebus_async.py @@ -22,7 +22,7 @@ async def process_message(message): - print(message) + print(str(message)) def example_create_servicebus_client_async(): @@ -206,14 +206,14 @@ async def example_send_and_receive_async(): async with servicebus_receiver: messages = await servicebus_receiver.peek_messages() for message in messages: - print(message) + print(str(message)) # [END peek_messages_async] # [START receive_async] async with servicebus_receiver: messages = await servicebus_receiver.receive_messages(max_wait_time=5) for message in messages: - print(message) + print(str(message)) await message.complete() # [END receive_async] @@ -240,7 +240,7 @@ async def example_receive_deferred_async(): messages = await servicebus_receiver.receive_messages(max_wait_time=5) for message in messages: deferred_sequenced_numbers.append(message.sequence_number) - print(message) + print(str(message)) await message.defer() received_deferred_msg = await servicebus_receiver.receive_deferred_messages( diff --git a/sdk/servicebus/azure-servicebus/samples/sync_samples/sample_code_servicebus.py b/sdk/servicebus/azure-servicebus/samples/sync_samples/sample_code_servicebus.py index ffa3a68f7f78..1e6393b8f288 100644 --- a/sdk/servicebus/azure-servicebus/samples/sync_samples/sample_code_servicebus.py +++ b/sdk/servicebus/azure-servicebus/samples/sync_samples/sample_code_servicebus.py @@ -18,7 +18,7 @@ def process_message(message): - print(message) + print(str(message)) def example_create_servicebus_client_sync(): @@ -213,7 +213,7 @@ def example_send_and_receive_sync(): with servicebus_receiver: messages = servicebus_receiver.peek_messages() for message in messages: - print(message) + print(str(message)) # [END peek_messages_sync] # [START auto_lock_renew_message_sync] @@ -232,7 +232,7 @@ def example_send_and_receive_sync(): with servicebus_receiver: messages = servicebus_receiver.receive_messages(max_wait_time=5) for message in messages: - print(message) + print(str(message)) message.complete() # [END receive_sync] @@ -269,7 +269,7 @@ def example_receive_deferred_sync(): messages = servicebus_receiver.receive_messages(max_wait_time=5) for message in messages: deferred_sequenced_numbers.append(message.sequence_number) - print(message) + print(str(message)) message.defer() received_deferred_msg = servicebus_receiver.receive_deferred_messages(