From 0dcf61fbb87e0778527c64bd3fe2692d8e0163b5 Mon Sep 17 00:00:00 2001 From: Andy Gee Date: Fri, 28 Aug 2020 18:07:47 -0700 Subject: [PATCH 1/2] update readme paths --- sdk/servicebus/azure-servicebus/README.md | 22 ++++++------ .../azure-servicebus/migration_guide.md | 32 ++++++++--------- .../azure-servicebus/samples/README.md | 34 +++++++++---------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/sdk/servicebus/azure-servicebus/README.md b/sdk/servicebus/azure-servicebus/README.md index 67ee777c5f10..e9aa26f5f72c 100644 --- a/sdk/servicebus/azure-servicebus/README.md +++ b/sdk/servicebus/azure-servicebus/README.md @@ -11,7 +11,7 @@ Use the Service Bus client library for Python to communicate between application * Send and receive messages within your Service Bus channels. * Utilize message locks, sessions, and dead letter functionality to implement complex messaging patterns. -[Source code](./) | [Package (PyPi)][pypi] | [API reference documentation][api_docs] | [Product documentation][product_docs] | [Samples](./samples) | [Changelog](./CHANGELOG.md) +[Source code](/sdk/servicebus/azure-servicebus) | [Package (PyPi)][pypi] | [API reference documentation][api_docs] | [Product documentation][product_docs] | [Samples](/sdk/servicebus/azure-servicebus/samples) | [Changelog](/sdk/servicebus/azure-servicebus/CHANGELOG.md) > **NOTE**: This document has instructions, links and code snippets for the **preview** of the next version of the `azure-servicebus` package > which has different APIs than the current version (0.50). Please view the resources below for references on the existing library. @@ -111,9 +111,9 @@ To interact with these resources, one should be familiar with the following SDK * [ServiceBusClient][client_reference]: This is the object a user should first initialize to connect to a Service Bus Namespace. To interact with a queue, topic, or subscription, one would spawn a sender or receiver off of this client. -* [Sender][sender_reference]: To send messages to a Queue or Topic, one would use the corresponding `get_queue_sender` or `get_topic_sender` method off of a `ServiceBusClient` instance as seen [here](./samples/sync_samples/send_queue.py). +* [Sender][sender_reference]: To send messages to a Queue or Topic, one would use the corresponding `get_queue_sender` or `get_topic_sender` method off of a `ServiceBusClient` instance as seen [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py). -* [Receiver][receiver_reference]: To receive messages from a Queue or Subscription, one would use the corresponding `get_queue_receiver` or `get_subscription_receiver` method off of a `ServiceBusClient` instance as seen [here](./samples/sync_samples/receive_queue.py). +* [Receiver][receiver_reference]: To receive messages from a Queue or Subscription, one would use the corresponding `get_queue_receiver` or `get_subscription_receiver` method off of a `ServiceBusClient` instance as seen [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py). * [Message][message_reference]: When sending, this is the type you will construct to contain your payload. When receiving, this is where you will access the payload and control how the message is "settled" (completed, dead-lettered, etc); these functions are only available on a received message. @@ -129,7 +129,7 @@ The following sections provide several code snippets covering some of the most c To perform management tasks such as creating and deleting queues/topics/subscriptions, please utilize the azure-mgmt-servicebus library, available [here][servicebus_management_repository]. -Please find further examples in the [samples](./samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. +Please find further examples in the [samples](/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. ### [Send messages to a queue][send_reference] @@ -154,7 +154,7 @@ with ServiceBusClient.from_connection_string(connstr) as client: ``` > **NOTE:** A message may be scheduled for delayed delivery using the `ServiceBusSender.schedule_messages()` method, or by specifying `Message.scheduled_enqueue_time_utc` before calling `ServiceBusSender.send_messages()` -> For more detail on scheduling and schedule cancellation please see a sample [here](./samples/sync_samples/schedule_messages_and_cancellation.py). +> For more detail on scheduling and schedule cancellation please see a sample [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py). ### Receive messages from a queue @@ -311,7 +311,7 @@ with ServiceBusClient.from_connection_string(connstr) as client: #### [DeadLetter][deadletter_reference] -Transfer the message from the primary queue into a special "dead-letter sub-queue" where it can be accessed using the `ServiceBusClient.get__deadletter_receiver` function and consumed from like any other receiver. (see sample [here](./samples/sync_samples/receive_deadlettered_messages.py)) +Transfer the message from the primary queue into a special "dead-letter sub-queue" where it can be accessed using the `ServiceBusClient.get__deadletter_receiver` function and consumed from like any other receiver. (see sample [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deadlettered_messages.py)) ```Python from azure.servicebus import ServiceBusClient @@ -330,7 +330,7 @@ with ServiceBusClient.from_connection_string(connstr) as client: #### [Defer][defer_reference] Defer is subtly different from the prior settlement methods. It prevents the message from being directly received from the queue -by setting it aside such that it must be received by sequence number in a call to `ServiceBusReceiver.receive_deferred_messages` (see sample [here](./samples/sync_samples/receive_deferred_message_queue.py)) +by setting it aside such that it must be received by sequence number in a call to `ServiceBusReceiver.receive_deferred_messages` (see sample [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deferred_message_queue.py)) ```Python from azure.servicebus import ServiceBusClient @@ -403,7 +403,7 @@ Please view the [exceptions reference docs][exception_reference] for detailed de ### More sample code -Please find further examples in the [samples](./samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. +Please find further examples in the [samples](/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. ### Additional documentation @@ -413,7 +413,7 @@ For more extensive documentation on the Service Bus service, see the [Service Bu For users seeking to perform management operations against ServiceBus (Creating a queue/topic/etc, altering filter rules, enumerating entities) please see the [azure-mgmt-servicebus documentation][service_bus_mgmt_docs] for API documentation. Terse usage examples can be found -[here](../azure-mgmt-servicebus/tests) as well. +[here](/sdk/servicebus/azure-mgmt-servicebus/tests) as well. ## Contributing @@ -454,7 +454,7 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio [servicebus_management_repository]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-mgmt-servicebus [get_servicebus_conn_str]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal#get-the-connection-string [servicebus_aad_authentication]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-authentication-and-authorization -[token_credential_interface]: ../../core/azure-core/azure/core/credentials.py +[token_credential_interface]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core/azure/core/credentials.py [pypi_azure_identity]: https://pypi.org/project/azure-identity/ [message_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.Message [receiver_reference]: https://azuresdkdocs.blob.core.windows.net/$web/python/azure-servicebus/latest/azure.servicebus.html#azure.servicebus.ServiceBusReceiver @@ -479,4 +479,4 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio [0_50_product_docs]: https://docs.microsoft.com/azure/service-bus-messaging/ [0_50_samples]: https://github.com/Azure/azure-sdk-for-python/tree/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/samples [0_50_changelog]: https://github.com/Azure/azure-sdk-for-python/blob/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/CHANGELOG.md -[migration_guide]: ./migration_guide.md +[migration_guide]: /sdk/servicebus/azure-servicebus/migration_guide.md diff --git a/sdk/servicebus/azure-servicebus/migration_guide.md b/sdk/servicebus/azure-servicebus/migration_guide.md index 8cc0aefd8c8e..f13da55c1420 100644 --- a/sdk/servicebus/azure-servicebus/migration_guide.md +++ b/sdk/servicebus/azure-servicebus/migration_guide.md @@ -3,7 +3,7 @@ This document is intended for users that are familiar with v0.50 of the Python SDK for Service Bus library (`azure-servicebus 0.50.x`) and wish to migrate their application to v7 of the same library. -For users new to the Python SDK for Service Bus, please see the [readme file for the azure-servicebus](./README.md). +For users new to the Python SDK for Service Bus, please see the [readme file for the azure-servicebus](/sdk/servicebus/azure-servicebus/README.md). ## General changes Version 7 of the azure-servicebus package is the result of our efforts to create a client library that is user-friendly and idiomatic to the Python ecosystem. @@ -33,38 +33,38 @@ semantics with the sender or receiver lifetime. | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `ServiceBusClient.from_connection_string()` | `ServiceBusClient.from_connection_string()` | [using credential](./samples/sync_samples/sample_code_servicebus.py ) | -| `QueueClient.from_connection_string()` | `ServiceBusClient.from_connection_string().get_queue_()` | [client initialization](./samples/sync_samples/send_queue.py ) | -| `QueueClient.from_connection_string(idle_timeout=None)` | `QueueClient.from_connection_string(max_wait_time=None)` | [providing a timeout](./samples/sync_samples/session_pool_receive.py) | +| `ServiceBusClient.from_connection_string()` | `ServiceBusClient.from_connection_string()` | [using credential](/sdk/servicebus/azure-servicebus/samples/sync_samples/sample_code_servicebus.py ) | +| `QueueClient.from_connection_string()` | `ServiceBusClient.from_connection_string().get_queue_()` | [client initialization](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py ) | +| `QueueClient.from_connection_string(idle_timeout=None)` | `QueueClient.from_connection_string(max_wait_time=None)` | [providing a timeout](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_pool_receive.py) | ### Receiving messages | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `QueueClient.from_connection_string().get_receiver().fetch_next() and ServiceBusClient.from_connection_string().get_queue().get_receiver().fetch_next()`| `ServiceBusClient.from_connection_string().get_queue_receiver().receive_messages()`| [Get a receiver and receive a single batch of messages](./samples/sync_samples/receive_queue.py) | -| `QueueClient.from_connection_string().get_receiver().peek() and ServiceBusClient.from_connection_string().get_queue().get_receiver().peek()`| `ServiceBusClient.from_connection_string().get_queue_receiver().peek_messages()`| [Get a receiver and receive a single batch of messages](./samples/sync_samples/receive_queue.py) | +| `QueueClient.from_connection_string().get_receiver().fetch_next() and ServiceBusClient.from_connection_string().get_queue().get_receiver().fetch_next()`| `ServiceBusClient.from_connection_string().get_queue_receiver().receive_messages()`| [Get a receiver and receive a single batch of messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) | +| `QueueClient.from_connection_string().get_receiver().peek() and ServiceBusClient.from_connection_string().get_queue().get_receiver().peek()`| `ServiceBusClient.from_connection_string().get_queue_receiver().peek_messages()`| [Get a receiver and receive a single batch of messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) | ### Sending messages | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `QueueClient.from_connection_string().send() and ServiceBusClient.from_connection_string().get_queue().get_sender().send()`| `ServiceBusClient.from_connection_string().get_queue_sender().send_messages()`| [Get a sender and send a message](./samples/sync_samples/send_queue.py) | -| `queue_client.send(BatchMessage(["data 1", "data 2", ...]))`| `batch = queue_sender.create_batch() batch.add(Message("data 1")) queue_sender.send_messages(batch)`| [Create and send a batch of messages](./samples/sync_samples/send_queue.py) | +| `QueueClient.from_connection_string().send() and ServiceBusClient.from_connection_string().get_queue().get_sender().send()`| `ServiceBusClient.from_connection_string().get_queue_sender().send_messages()`| [Get a sender and send a message](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) | +| `queue_client.send(BatchMessage(["data 1", "data 2", ...]))`| `batch = queue_sender.create_batch() batch.add(Message("data 1")) queue_sender.send_messages(batch)`| [Create and send a batch of messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) | ### Scheduling messages and cancelling scheduled messages | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `queue_client.get_sender().schedule(schedule_time_utc, message1, message2)` | `sb_client.get_queue_sender().schedule_messages([message1, message2], schedule_time_utc)` | [Schedule messages](./samples/sync_samples/schedule_messages_and_cancellation.py) | -| `queue_client.get_sender().cancel_scheduled_messages(sequence_number1, sequence_number2)`| `sb_client.get_queue_sender().cancel_scheduled_messages([sequence_number1, sequence_number2])` | [Cancel scheduled messages](./samples/sync_samples/schedule_messages_and_cancellation.py)| +| `queue_client.get_sender().schedule(schedule_time_utc, message1, message2)` | `sb_client.get_queue_sender().schedule_messages([message1, message2], schedule_time_utc)` | [Schedule messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py) | +| `queue_client.get_sender().cancel_scheduled_messages(sequence_number1, sequence_number2)`| `sb_client.get_queue_sender().cancel_scheduled_messages([sequence_number1, sequence_number2])` | [Cancel scheduled messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py)| ### Working with sessions | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `queue_client.send(message, session='foo') and queue_client.get_sender(session='foo').send(message)`| `sb_client.get_queue_sender().send_messages(Message('body', session_id='foo'))`| [Send a message to a session](./samples/sync_samples/session_send_receive.py) | -| `AutoLockRenew().register(queue_client.get_receiver(session='foo'))`| `AutoLockRenew().register(sb_client.get_queue_session_receiver(session_id='foo').session)`| [Access a session and ensure its lock is auto-renewed](./samples/sync_samples/session_send_receive.py) | -| `receiver.get_session_state()` | `receiver.session.get_session_state()` | [Perform session specific operations on a receiver](./samples/sync_samples/session_send_receive.py) +| `queue_client.send(message, session='foo') and queue_client.get_sender(session='foo').send(message)`| `sb_client.get_queue_sender().send_messages(Message('body', session_id='foo'))`| [Send a message to a session](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) | +| `AutoLockRenew().register(queue_client.get_receiver(session='foo'))`| `AutoLockRenew().register(sb_client.get_queue_session_receiver(session_id='foo').session)`| [Access a session and ensure its lock is auto-renewed](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) | +| `receiver.get_session_state()` | `receiver.session.get_session_state()` | [Perform session specific operations on a receiver](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) ### Working with UTC time | In v0.50 | Equivalent in v7 | Note | @@ -75,13 +75,13 @@ semantics with the sender or receiver lifetime. ### Managing queues | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `azure.servicebus.control_client.ServiceBusService().create_queue(queue_name)` | `azure.servicebus.management.ServiceBusManagementClient().create_queue(queue_name)` | [Create a queue](./samples/sync_samples/mgmt_queue.py) | -| `azure.servicebus.ServiceBusClient().list_queues()` | `azure.servicebus.management.ServiceBusManagementClient().list_queues()` | [List queues](./samples/sync_samples/mgmt_queue.py ) | +| `azure.servicebus.control_client.ServiceBusService().create_queue(queue_name)` | `azure.servicebus.management.ServiceBusManagementClient().create_queue(queue_name)` | [Create a queue](/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py) | +| `azure.servicebus.ServiceBusClient().list_queues()` | `azure.servicebus.management.ServiceBusManagementClient().list_queues()` | [List queues](/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py ) | ### Working with AutoLockRenew | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `azure.servicebus.AutoLockRenew().shutdown()` | `azure.servicebus.AutoLockRenew().close()` | [Close an auto-lock-renewer](./samples/sync_samples/auto_lock_renew.py) | +| `azure.servicebus.AutoLockRenew().shutdown()` | `azure.servicebus.AutoLockRenew().close()` | [Close an auto-lock-renewer](/sdk/servicebus/azure-servicebus/samples/sync_samples/auto_lock_renew.py) | ## Migration samples diff --git a/sdk/servicebus/azure-servicebus/samples/README.md b/sdk/servicebus/azure-servicebus/samples/README.md index 103a49d2e729..9346fde43366 100644 --- a/sdk/servicebus/azure-servicebus/samples/README.md +++ b/sdk/servicebus/azure-servicebus/samples/README.md @@ -14,48 +14,48 @@ urlFragment: servicebus-samples > which has different APIs than the current version (0.50). Please visit [this link](https://github.com/Azure/azure-sdk-for-python/tree/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/samples) for samples of the existing library. These are code samples that show common scenario operations with the Azure Service Bus client library. -Both [sync version](./sync_samples) and [async version](./async_samples) of samples are provided, async samples require Python 3.5 or later. +Both [sync version](/sdk/servicebus/sync_samples) and [async version](/sdk/servicebus/async_samples) of samples are provided, async samples require Python 3.5 or later. -- [send_queue.py](./sync_samples/send_queue.py) ([async version](./async_samples/send_queue_async.py)) - Examples to send messages to a service bus queue: +- [send_queue.py](/sdk/servicebus/sync_samples/send_queue.py) ([async version](/sdk/servicebus/async_samples/send_queue_async.py)) - Examples to send messages to a service bus queue: - From a connection string - Enabling Logging -- [send_topic.py](./sync_samples/send_topic.py) ([async version](./async_samples/send_topic_async.py)) - Examples to send messages to a service bus topic: +- [send_topic.py](/sdk/servicebus/sync_samples/send_topic.py) ([async version](/sdk/servicebus/async_samples/send_topic_async.py)) - Examples to send messages to a service bus topic: - From a connection string - Enabling Logging -- [receive_queue.py](./sync_samples/receive_queue.py) ([async_version](./async_samples/receive_queue_async.py)) - Examples to receive messages from a service bus queue: +- [receive_queue.py](/sdk/servicebus/sync_samples/receive_queue.py) ([async_version](/sdk/servicebus/async_samples/receive_queue_async.py)) - Examples to receive messages from a service bus queue: - Receive messages -- [receive_subscription.py](./sync_samples/receive_subscription.py) ([async_version](./async_samples/receive_subscription_async.py)) - Examples to receive messages from a service bus subscription: +- [receive_subscription.py](/sdk/servicebus/sync_samples/receive_subscription.py) ([async_version](/sdk/servicebus/async_samples/receive_subscription_async.py)) - Examples to receive messages from a service bus subscription: - Receive messages -- [receive_peek.py](./sync_samples/receive_peek.py) ([async_version](./async_samples/receive_peek_async.py)) - Examples to peek messages from a service bus queue: +- [receive_peek.py](/sdk/servicebus/sync_samples/receive_peek.py) ([async_version](/sdk/servicebus/async_samples/receive_peek_async.py)) - Examples to peek messages from a service bus queue: - Peek messages -- [receive_deferred_message_queue.py](./sync_samples/receive_deferred_message_queue.py) ([async_version](./async_samples/receive_deferred_message_queue_async.py)) - Examples to defer received messages and receive deferred messages from a service bus queue: +- [receive_deferred_message_queue.py](/sdk/servicebus/sync_samples/receive_deferred_message_queue.py) ([async_version](/sdk/servicebus/async_samples/receive_deferred_message_queue_async.py)) - Examples to defer received messages and receive deferred messages from a service bus queue: - Defer received messages - Receive deferred messages -- [receive_deadlettered_messages.py](./sync_samples/receive_deadlettered_messages.py) ([async_version](./async_samples/receive_deadlettered_messages_async.py)) - Examples to receive dead-lettered messages from a service bus queue: +- [receive_deadlettered_messages.py](/sdk/servicebus/sync_samples/receive_deadlettered_messages.py) ([async_version](/sdk/servicebus/async_samples/receive_deadlettered_messages_async.py)) - Examples to receive dead-lettered messages from a service bus queue: - Receive dead-lettered messages -- [receive_iterator_queue.py](./sync_samples/receive_iterator_queue.py) ([async_version](./async_samples/receive_iterator_queue_async.py)) - Examples to receive messages from a service bus queue by iterating over ServiceBusReceiver: +- [receive_iterator_queue.py](/sdk/servicebus/sync_samples/receive_iterator_queue.py) ([async_version](/sdk/servicebus/async_samples/receive_iterator_queue_async.py)) - Examples to receive messages from a service bus queue by iterating over ServiceBusReceiver: - Receive messages by iterating over ServiceBusReceiver -- [session_pool_receive.py](./sync_samples/session_pool_receive.py) ([async_version](./async_samples/session_pool_receive_async.py)) - Examples to receive messages from multiple available sessions in parallel with a thread pool: +- [session_pool_receive.py](/sdk/servicebus/sync_samples/session_pool_receive.py) ([async_version](/sdk/servicebus/async_samples/session_pool_receive_async.py)) - Examples to receive messages from multiple available sessions in parallel with a thread pool: - Receive messages from multiple available sessions in parallel with a thread pool - Automatically renew the lock on the session through AutoLockRenew -- [session_send_receive.py](./sync_samples/session_send_receive.py) ([async_version](./async_samples/session_send_receive_async.py)) - Examples to send messages to and receive messages from a session-enabled service bus queue: +- [session_send_receive.py](/sdk/servicebus/sync_samples/session_send_receive.py) ([async_version](/sdk/servicebus/async_samples/session_send_receive_async.py)) - Examples to send messages to and receive messages from a session-enabled service bus queue: - Send messages to a session-enabled queue - Receive messages from session-enabled queue -- [schedule_messages_and_cancellation](./sync_samples/schedule_messages_and_cancellation.py) ([async_version](./async_samples/schedule_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus queue: +- [schedule_messages_and_cancellation](/sdk/servicebus/sync_samples/schedule_messages_and_cancellation.py) ([async_version](/sdk/servicebus/async_samples/schedule_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus queue: - Schedule a single message or multiple messages to a queue - Cancel scheduled messages from a queue -- [schedule_topic_messages_and_cancellation](./sync_samples/schedule_topic_messages_and_cancellation.py) ([async_version](./async_samples/schedule_topic_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus topic: +- [schedule_topic_messages_and_cancellation](/sdk/servicebus/sync_samples/schedule_topic_messages_and_cancellation.py) ([async_version](/sdk/servicebus/async_samples/schedule_topic_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus topic: - Schedule a single message or multiple messages to a topic - Cancel scheduled messages from a topic -- [client_identity_authentication.py](./sync_samples/client_identity_authentication.py) ([async_version](./async_samples/client_identity_authentication_async.py)) - Examples to authenticate the client by Azure Activate Directory +- [client_identity_authentication.py](/sdk/servicebus/sync_samples/client_identity_authentication.py) ([async_version](/sdk/servicebus/async_samples/client_identity_authentication_async.py)) - Examples to authenticate the client by Azure Activate Directory - Authenticate and create the client utilizing the `azure.identity` library -- [proxy.py](./sync_samples/proxy.py) ([async_version](./async_samples/proxy_async.py)) - Examples to send message behind a proxy: +- [proxy.py](/sdk/servicebus/sync_samples/proxy.py) ([async_version](/sdk/servicebus/async_samples/proxy_async.py)) - Examples to send message behind a proxy: - Send message behind a proxy -- [auto_lock_renew.py](./sync_samples/auto_lock_renew.py) ([async_version](./async_samples/auto_lock_renew_async.py)) - Examples to show usage of AutoLockRenew: +- [auto_lock_renew.py](/sdk/servicebus/sync_samples/auto_lock_renew.py) ([async_version](/sdk/servicebus/async_samples/auto_lock_renew_async.py)) - Examples to show usage of AutoLockRenew: - Automatically renew lock on message received from non-sessionful entity - Automatically renew lock on the session of sessionful entity - Configure a callback to be triggered on auto lock renew failures. -- [mgmt_queue](./sync_samples/mgmt_queue.py) ([async_version](./async_samples/mgmt_queue_async.py)) - Examples to manage queue entities under a given servicebus namespace +- [mgmt_queue](/sdk/servicebus/sync_samples/mgmt_queue.py) ([async_version](/sdk/servicebus/async_samples/mgmt_queue_async.py)) - Examples to manage queue entities under a given servicebus namespace - Create a queue - Delete a queue - Update a queue From 12601ce7afb7bede2093e3c0b86216af5216c29a Mon Sep 17 00:00:00 2001 From: Andy Gee Date: Fri, 28 Aug 2020 18:50:23 -0700 Subject: [PATCH 2/2] update for urls --- sdk/servicebus/azure-servicebus/README.md | 22 +++++++----- .../azure-servicebus/migration_guide.md | 32 ++++++++--------- .../azure-servicebus/samples/README.md | 34 +++++++++---------- 3 files changed, 46 insertions(+), 42 deletions(-) diff --git a/sdk/servicebus/azure-servicebus/README.md b/sdk/servicebus/azure-servicebus/README.md index e9aa26f5f72c..91fc6be5bd7f 100644 --- a/sdk/servicebus/azure-servicebus/README.md +++ b/sdk/servicebus/azure-servicebus/README.md @@ -11,7 +11,7 @@ Use the Service Bus client library for Python to communicate between application * Send and receive messages within your Service Bus channels. * Utilize message locks, sessions, and dead letter functionality to implement complex messaging patterns. -[Source code](/sdk/servicebus/azure-servicebus) | [Package (PyPi)][pypi] | [API reference documentation][api_docs] | [Product documentation][product_docs] | [Samples](/sdk/servicebus/azure-servicebus/samples) | [Changelog](/sdk/servicebus/azure-servicebus/CHANGELOG.md) +[Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/) | [Package (PyPi)][pypi] | [API reference documentation][api_docs] | [Product documentation][product_docs] | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples) | [Changelog](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/CHANGELOG.md) > **NOTE**: This document has instructions, links and code snippets for the **preview** of the next version of the `azure-servicebus` package > which has different APIs than the current version (0.50). Please view the resources below for references on the existing library. @@ -111,9 +111,9 @@ To interact with these resources, one should be familiar with the following SDK * [ServiceBusClient][client_reference]: This is the object a user should first initialize to connect to a Service Bus Namespace. To interact with a queue, topic, or subscription, one would spawn a sender or receiver off of this client. -* [Sender][sender_reference]: To send messages to a Queue or Topic, one would use the corresponding `get_queue_sender` or `get_topic_sender` method off of a `ServiceBusClient` instance as seen [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py). +* [Sender][sender_reference]: To send messages to a Queue or Topic, one would use the corresponding `get_queue_sender` or `get_topic_sender` method off of a `ServiceBusClient` instance as seen [here](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py). -* [Receiver][receiver_reference]: To receive messages from a Queue or Subscription, one would use the corresponding `get_queue_receiver` or `get_subscription_receiver` method off of a `ServiceBusClient` instance as seen [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py). +* [Receiver][receiver_reference]: To receive messages from a Queue or Subscription, one would use the corresponding `get_queue_receiver` or `get_subscription_receiver` method off of a `ServiceBusClient` instance as seen [here](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py). * [Message][message_reference]: When sending, this is the type you will construct to contain your payload. When receiving, this is where you will access the payload and control how the message is "settled" (completed, dead-lettered, etc); these functions are only available on a received message. @@ -129,7 +129,7 @@ The following sections provide several code snippets covering some of the most c To perform management tasks such as creating and deleting queues/topics/subscriptions, please utilize the azure-mgmt-servicebus library, available [here][servicebus_management_repository]. -Please find further examples in the [samples](/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. +Please find further examples in the [samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. ### [Send messages to a queue][send_reference] @@ -154,7 +154,7 @@ with ServiceBusClient.from_connection_string(connstr) as client: ``` > **NOTE:** A message may be scheduled for delayed delivery using the `ServiceBusSender.schedule_messages()` method, or by specifying `Message.scheduled_enqueue_time_utc` before calling `ServiceBusSender.send_messages()` -> For more detail on scheduling and schedule cancellation please see a sample [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py). +> For more detail on scheduling and schedule cancellation please see a sample [here](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py). ### Receive messages from a queue @@ -311,7 +311,7 @@ with ServiceBusClient.from_connection_string(connstr) as client: #### [DeadLetter][deadletter_reference] -Transfer the message from the primary queue into a special "dead-letter sub-queue" where it can be accessed using the `ServiceBusClient.get__deadletter_receiver` function and consumed from like any other receiver. (see sample [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deadlettered_messages.py)) +Transfer the message from the primary queue into a special "dead-letter sub-queue" where it can be accessed using the `ServiceBusClient.get__deadletter_receiver` function and consumed from like any other receiver. (see sample [here](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deadlettered_messages.py)) ```Python from azure.servicebus import ServiceBusClient @@ -330,7 +330,7 @@ with ServiceBusClient.from_connection_string(connstr) as client: #### [Defer][defer_reference] Defer is subtly different from the prior settlement methods. It prevents the message from being directly received from the queue -by setting it aside such that it must be received by sequence number in a call to `ServiceBusReceiver.receive_deferred_messages` (see sample [here](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deferred_message_queue.py)) +by setting it aside such that it must be received by sequence number in a call to `ServiceBusReceiver.receive_deferred_messages` (see sample [here](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deferred_message_queue.py)) ```Python from azure.servicebus import ServiceBusClient @@ -403,7 +403,7 @@ Please view the [exceptions reference docs][exception_reference] for detailed de ### More sample code -Please find further examples in the [samples](/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. +Please find further examples in the [samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples) directory demonstrating common Service Bus scenarios such as sending, receiving, session management and message handling. ### Additional documentation @@ -413,7 +413,7 @@ For more extensive documentation on the Service Bus service, see the [Service Bu For users seeking to perform management operations against ServiceBus (Creating a queue/topic/etc, altering filter rules, enumerating entities) please see the [azure-mgmt-servicebus documentation][service_bus_mgmt_docs] for API documentation. Terse usage examples can be found -[here](/sdk/servicebus/azure-mgmt-servicebus/tests) as well. +[here](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-mgmt-servicebus/tests) as well. ## Contributing @@ -479,4 +479,8 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio [0_50_product_docs]: https://docs.microsoft.com/azure/service-bus-messaging/ [0_50_samples]: https://github.com/Azure/azure-sdk-for-python/tree/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/samples [0_50_changelog]: https://github.com/Azure/azure-sdk-for-python/blob/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/CHANGELOG.md +<<<<<<< Updated upstream [migration_guide]: /sdk/servicebus/azure-servicebus/migration_guide.md +======= +[migration_guide]: https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/migration_guide.md +>>>>>>> Stashed changes diff --git a/sdk/servicebus/azure-servicebus/migration_guide.md b/sdk/servicebus/azure-servicebus/migration_guide.md index f13da55c1420..1f10f9dd7fcd 100644 --- a/sdk/servicebus/azure-servicebus/migration_guide.md +++ b/sdk/servicebus/azure-servicebus/migration_guide.md @@ -3,7 +3,7 @@ This document is intended for users that are familiar with v0.50 of the Python SDK for Service Bus library (`azure-servicebus 0.50.x`) and wish to migrate their application to v7 of the same library. -For users new to the Python SDK for Service Bus, please see the [readme file for the azure-servicebus](/sdk/servicebus/azure-servicebus/README.md). +For users new to the Python SDK for Service Bus, please see the [readme file for the azure-servicebus](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/README.md). ## General changes Version 7 of the azure-servicebus package is the result of our efforts to create a client library that is user-friendly and idiomatic to the Python ecosystem. @@ -33,38 +33,38 @@ semantics with the sender or receiver lifetime. | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `ServiceBusClient.from_connection_string()` | `ServiceBusClient.from_connection_string()` | [using credential](/sdk/servicebus/azure-servicebus/samples/sync_samples/sample_code_servicebus.py ) | -| `QueueClient.from_connection_string()` | `ServiceBusClient.from_connection_string().get_queue_()` | [client initialization](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py ) | -| `QueueClient.from_connection_string(idle_timeout=None)` | `QueueClient.from_connection_string(max_wait_time=None)` | [providing a timeout](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_pool_receive.py) | +| `ServiceBusClient.from_connection_string()` | `ServiceBusClient.from_connection_string()` | [using credential](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/sample_code_servicebus.py ) | +| `QueueClient.from_connection_string()` | `ServiceBusClient.from_connection_string().get_queue_()` | [client initialization](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py ) | +| `QueueClient.from_connection_string(idle_timeout=None)` | `QueueClient.from_connection_string(max_wait_time=None)` | [providing a timeout](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/session_pool_receive.py) | ### Receiving messages | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `QueueClient.from_connection_string().get_receiver().fetch_next() and ServiceBusClient.from_connection_string().get_queue().get_receiver().fetch_next()`| `ServiceBusClient.from_connection_string().get_queue_receiver().receive_messages()`| [Get a receiver and receive a single batch of messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) | -| `QueueClient.from_connection_string().get_receiver().peek() and ServiceBusClient.from_connection_string().get_queue().get_receiver().peek()`| `ServiceBusClient.from_connection_string().get_queue_receiver().peek_messages()`| [Get a receiver and receive a single batch of messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) | +| `QueueClient.from_connection_string().get_receiver().fetch_next() and ServiceBusClient.from_connection_string().get_queue().get_receiver().fetch_next()`| `ServiceBusClient.from_connection_string().get_queue_receiver().receive_messages()`| [Get a receiver and receive a single batch of messages](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) | +| `QueueClient.from_connection_string().get_receiver().peek() and ServiceBusClient.from_connection_string().get_queue().get_receiver().peek()`| `ServiceBusClient.from_connection_string().get_queue_receiver().peek_messages()`| [Get a receiver and receive a single batch of messages](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) | ### Sending messages | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `QueueClient.from_connection_string().send() and ServiceBusClient.from_connection_string().get_queue().get_sender().send()`| `ServiceBusClient.from_connection_string().get_queue_sender().send_messages()`| [Get a sender and send a message](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) | -| `queue_client.send(BatchMessage(["data 1", "data 2", ...]))`| `batch = queue_sender.create_batch() batch.add(Message("data 1")) queue_sender.send_messages(batch)`| [Create and send a batch of messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) | +| `QueueClient.from_connection_string().send() and ServiceBusClient.from_connection_string().get_queue().get_sender().send()`| `ServiceBusClient.from_connection_string().get_queue_sender().send_messages()`| [Get a sender and send a message](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) | +| `queue_client.send(BatchMessage(["data 1", "data 2", ...]))`| `batch = queue_sender.create_batch() batch.add(Message("data 1")) queue_sender.send_messages(batch)`| [Create and send a batch of messages](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) | ### Scheduling messages and cancelling scheduled messages | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `queue_client.get_sender().schedule(schedule_time_utc, message1, message2)` | `sb_client.get_queue_sender().schedule_messages([message1, message2], schedule_time_utc)` | [Schedule messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py) | -| `queue_client.get_sender().cancel_scheduled_messages(sequence_number1, sequence_number2)`| `sb_client.get_queue_sender().cancel_scheduled_messages([sequence_number1, sequence_number2])` | [Cancel scheduled messages](/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py)| +| `queue_client.get_sender().schedule(schedule_time_utc, message1, message2)` | `sb_client.get_queue_sender().schedule_messages([message1, message2], schedule_time_utc)` | [Schedule messages](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py) | +| `queue_client.get_sender().cancel_scheduled_messages(sequence_number1, sequence_number2)`| `sb_client.get_queue_sender().cancel_scheduled_messages([sequence_number1, sequence_number2])` | [Cancel scheduled messages](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py)| ### Working with sessions | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `queue_client.send(message, session='foo') and queue_client.get_sender(session='foo').send(message)`| `sb_client.get_queue_sender().send_messages(Message('body', session_id='foo'))`| [Send a message to a session](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) | -| `AutoLockRenew().register(queue_client.get_receiver(session='foo'))`| `AutoLockRenew().register(sb_client.get_queue_session_receiver(session_id='foo').session)`| [Access a session and ensure its lock is auto-renewed](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) | -| `receiver.get_session_state()` | `receiver.session.get_session_state()` | [Perform session specific operations on a receiver](/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) +| `queue_client.send(message, session='foo') and queue_client.get_sender(session='foo').send(message)`| `sb_client.get_queue_sender().send_messages(Message('body', session_id='foo'))`| [Send a message to a session](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) | +| `AutoLockRenew().register(queue_client.get_receiver(session='foo'))`| `AutoLockRenew().register(sb_client.get_queue_session_receiver(session_id='foo').session)`| [Access a session and ensure its lock is auto-renewed](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) | +| `receiver.get_session_state()` | `receiver.session.get_session_state()` | [Perform session specific operations on a receiver](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) ### Working with UTC time | In v0.50 | Equivalent in v7 | Note | @@ -75,13 +75,13 @@ semantics with the sender or receiver lifetime. ### Managing queues | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `azure.servicebus.control_client.ServiceBusService().create_queue(queue_name)` | `azure.servicebus.management.ServiceBusManagementClient().create_queue(queue_name)` | [Create a queue](/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py) | -| `azure.servicebus.ServiceBusClient().list_queues()` | `azure.servicebus.management.ServiceBusManagementClient().list_queues()` | [List queues](/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py ) | +| `azure.servicebus.control_client.ServiceBusService().create_queue(queue_name)` | `azure.servicebus.management.ServiceBusManagementClient().create_queue(queue_name)` | [Create a queue](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py) | +| `azure.servicebus.ServiceBusClient().list_queues()` | `azure.servicebus.management.ServiceBusManagementClient().list_queues()` | [List queues](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py ) | ### Working with AutoLockRenew | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `azure.servicebus.AutoLockRenew().shutdown()` | `azure.servicebus.AutoLockRenew().close()` | [Close an auto-lock-renewer](/sdk/servicebus/azure-servicebus/samples/sync_samples/auto_lock_renew.py) | +| `azure.servicebus.AutoLockRenew().shutdown()` | `azure.servicebus.AutoLockRenew().close()` | [Close an auto-lock-renewer](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/auto_lock_renew.py) | ## Migration samples diff --git a/sdk/servicebus/azure-servicebus/samples/README.md b/sdk/servicebus/azure-servicebus/samples/README.md index 9346fde43366..65a840545dd3 100644 --- a/sdk/servicebus/azure-servicebus/samples/README.md +++ b/sdk/servicebus/azure-servicebus/samples/README.md @@ -14,48 +14,48 @@ urlFragment: servicebus-samples > which has different APIs than the current version (0.50). Please visit [this link](https://github.com/Azure/azure-sdk-for-python/tree/servicebus_v0.50.3/sdk/servicebus/azure-servicebus/samples) for samples of the existing library. These are code samples that show common scenario operations with the Azure Service Bus client library. -Both [sync version](/sdk/servicebus/sync_samples) and [async version](/sdk/servicebus/async_samples) of samples are provided, async samples require Python 3.5 or later. +Both [sync version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples) and [async version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples) of samples are provided, async samples require Python 3.5 or later. -- [send_queue.py](/sdk/servicebus/sync_samples/send_queue.py) ([async version](/sdk/servicebus/async_samples/send_queue_async.py)) - Examples to send messages to a service bus queue: +- [send_queue.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/send_queue_async.py)) - Examples to send messages to a service bus queue: - From a connection string - Enabling Logging -- [send_topic.py](/sdk/servicebus/sync_samples/send_topic.py) ([async version](/sdk/servicebus/async_samples/send_topic_async.py)) - Examples to send messages to a service bus topic: +- [send_topic.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/send_topic.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/send_topic_async.py)) - Examples to send messages to a service bus topic: - From a connection string - Enabling Logging -- [receive_queue.py](/sdk/servicebus/sync_samples/receive_queue.py) ([async_version](/sdk/servicebus/async_samples/receive_queue_async.py)) - Examples to receive messages from a service bus queue: +- [receive_queue.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/receive_queue_async.py)) - Examples to receive messages from a service bus queue: - Receive messages -- [receive_subscription.py](/sdk/servicebus/sync_samples/receive_subscription.py) ([async_version](/sdk/servicebus/async_samples/receive_subscription_async.py)) - Examples to receive messages from a service bus subscription: +- [receive_subscription.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_subscription.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/receive_subscription_async.py)) - Examples to receive messages from a service bus subscription: - Receive messages -- [receive_peek.py](/sdk/servicebus/sync_samples/receive_peek.py) ([async_version](/sdk/servicebus/async_samples/receive_peek_async.py)) - Examples to peek messages from a service bus queue: +- [receive_peek.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_peek.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/receive_peek_async.py)) - Examples to peek messages from a service bus queue: - Peek messages -- [receive_deferred_message_queue.py](/sdk/servicebus/sync_samples/receive_deferred_message_queue.py) ([async_version](/sdk/servicebus/async_samples/receive_deferred_message_queue_async.py)) - Examples to defer received messages and receive deferred messages from a service bus queue: +- [receive_deferred_message_queue.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deferred_message_queue.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/receive_deferred_message_queue_async.py)) - Examples to defer received messages and receive deferred messages from a service bus queue: - Defer received messages - Receive deferred messages -- [receive_deadlettered_messages.py](/sdk/servicebus/sync_samples/receive_deadlettered_messages.py) ([async_version](/sdk/servicebus/async_samples/receive_deadlettered_messages_async.py)) - Examples to receive dead-lettered messages from a service bus queue: +- [receive_deadlettered_messages.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_deadlettered_messages.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/receive_deadlettered_messages_async.py)) - Examples to receive dead-lettered messages from a service bus queue: - Receive dead-lettered messages -- [receive_iterator_queue.py](/sdk/servicebus/sync_samples/receive_iterator_queue.py) ([async_version](/sdk/servicebus/async_samples/receive_iterator_queue_async.py)) - Examples to receive messages from a service bus queue by iterating over ServiceBusReceiver: +- [receive_iterator_queue.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_iterator_queue.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/receive_iterator_queue_async.py)) - Examples to receive messages from a service bus queue by iterating over ServiceBusReceiver: - Receive messages by iterating over ServiceBusReceiver -- [session_pool_receive.py](/sdk/servicebus/sync_samples/session_pool_receive.py) ([async_version](/sdk/servicebus/async_samples/session_pool_receive_async.py)) - Examples to receive messages from multiple available sessions in parallel with a thread pool: +- [session_pool_receive.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/session_pool_receive.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/session_pool_receive_async.py)) - Examples to receive messages from multiple available sessions in parallel with a thread pool: - Receive messages from multiple available sessions in parallel with a thread pool - Automatically renew the lock on the session through AutoLockRenew -- [session_send_receive.py](/sdk/servicebus/sync_samples/session_send_receive.py) ([async_version](/sdk/servicebus/async_samples/session_send_receive_async.py)) - Examples to send messages to and receive messages from a session-enabled service bus queue: +- [session_send_receive.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/session_send_receive.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/session_send_receive_async.py)) - Examples to send messages to and receive messages from a session-enabled service bus queue: - Send messages to a session-enabled queue - Receive messages from session-enabled queue -- [schedule_messages_and_cancellation](/sdk/servicebus/sync_samples/schedule_messages_and_cancellation.py) ([async_version](/sdk/servicebus/async_samples/schedule_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus queue: +- [schedule_messages_and_cancellation](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_messages_and_cancellation.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/schedule_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus queue: - Schedule a single message or multiple messages to a queue - Cancel scheduled messages from a queue -- [schedule_topic_messages_and_cancellation](/sdk/servicebus/sync_samples/schedule_topic_messages_and_cancellation.py) ([async_version](/sdk/servicebus/async_samples/schedule_topic_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus topic: +- [schedule_topic_messages_and_cancellation](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_topic_messages_and_cancellation.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/schedule_topic_messages_and_cancellation_async.py)) - Examples to schedule messages and cancel scheduled messages on a service bus topic: - Schedule a single message or multiple messages to a topic - Cancel scheduled messages from a topic -- [client_identity_authentication.py](/sdk/servicebus/sync_samples/client_identity_authentication.py) ([async_version](/sdk/servicebus/async_samples/client_identity_authentication_async.py)) - Examples to authenticate the client by Azure Activate Directory +- [client_identity_authentication.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/client_identity_authentication.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/client_identity_authentication_async.py)) - Examples to authenticate the client by Azure Activate Directory - Authenticate and create the client utilizing the `azure.identity` library -- [proxy.py](/sdk/servicebus/sync_samples/proxy.py) ([async_version](/sdk/servicebus/async_samples/proxy_async.py)) - Examples to send message behind a proxy: +- [proxy.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/proxy.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/proxy_async.py)) - Examples to send message behind a proxy: - Send message behind a proxy -- [auto_lock_renew.py](/sdk/servicebus/sync_samples/auto_lock_renew.py) ([async_version](/sdk/servicebus/async_samples/auto_lock_renew_async.py)) - Examples to show usage of AutoLockRenew: +- [auto_lock_renew.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/auto_lock_renew.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/auto_lock_renew_async.py)) - Examples to show usage of AutoLockRenew: - Automatically renew lock on message received from non-sessionful entity - Automatically renew lock on the session of sessionful entity - Configure a callback to be triggered on auto lock renew failures. -- [mgmt_queue](/sdk/servicebus/sync_samples/mgmt_queue.py) ([async_version](/sdk/servicebus/async_samples/mgmt_queue_async.py)) - Examples to manage queue entities under a given servicebus namespace +- [mgmt_queue](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/mgmt_queue_async.py)) - Examples to manage queue entities under a given servicebus namespace - Create a queue - Delete a queue - Update a queue