快速入門:如何透過 PHP 使用服務匯流排主題和訂用帳戶Quickstart: How to use Service Bus topics and subscriptions with PHP

本文示範如何使用服務匯流排主題和訂用帳戶。This article shows you how to use Service Bus topics and subscriptions. 這些範例均是以 PHP 撰寫,並使用 Azure SDK for PHP (英文)。The samples are written in PHP and use the Azure SDK for PHP. 涵蓋的案例包括:The scenarios covered include:

  • 建立主題和訂用帳戶Creating topics and subscriptions
  • 建立訂用帳戶篩選Creating subscription filters
  • 傳送訊息至主題Sending messages to a topic
  • 從訂用帳戶接收訊息Receiving messages from a subscription
  • 刪除主題和訂用帳戶Deleting topics and subscriptions

PrerequisitesPrerequisites

  1. Azure 訂用帳戶。An Azure subscription. 若要完成此教學課程,您需要 Azure 帳戶。To complete this tutorial, you need an Azure account. 您可以啟用自己的 Visual Studio 或 MSDN 訂閱者權益或註冊免費帳戶You can activate your Visual Studio or MSDN subscriber benefits or sign up for a free account.

  2. 依照下列快速入門中的步驟操作:快速入門:使用 Azure 入口網站建立服務匯流排主題和主題的訂用帳戶,以建立服務匯流排命名空間及取得連接字串Follow steps in the Quickstart: Use the Azure portal to create a Service Bus topic and subscriptions to the topic to create a Service Bus namespace and get the connection string.

    注意

    您將會在本快速入門中使用 PHP,建立主題和主題的訂用帳戶You will create a topic and a subscription to the topic by using PHP in this quickstart.

建立 PHP 應用程式Create a PHP application

若要建立 PHP 應用程式並使其存取 Azure Blob 服務,唯一要求就是在您的程式碼中參考 Azure SDK for PHP 中的類別。The only requirement for creating a PHP application that accesses the Azure Blob service is to reference classes in the Azure SDK for PHP from within your code. 您可以使用任何開發工具來建立應用程式,或記事本。You can use any development tools to create your application, or Notepad.

注意

您的 PHP 安裝也必須已安裝並啟用 OpenSSL 延伸模組Your PHP installation must also have the OpenSSL extension installed and enabled.

本文說明如何使用可從 PHP 應用程式內本機呼叫的服務功能,或可在 Azure Web 角色、背景工作角色或網站內執行的程式碼中呼叫的服務功能。This article describes how to use service features that can be called within a PHP application locally, or in code running within an Azure web role, worker role, or website.

取得 Azure 用戶端程式庫Get the Azure client libraries

透過編輯器安裝Install via Composer

  1. 在專案的根目錄中建立名為 composer.json 的檔案,並新增下列程式碼:Create a file named composer.json in the root of your project and add the following code to it:

    {
      "require": {
        "microsoft/windowsazure": "*"
      }
    }
    
  2. [composer.phar][composer-phar] 下載到您的專案根目錄中。Download [composer.phar][composer-phar] in your project root.

  3. 開啟命令提示字元,在專案根目錄中執行下列命令Open a command prompt and execute the following command in your project root

    php composer.phar install
    

設定應用程式以使用服務匯流排Configure your application to use Service Bus

若要使用服務匯流排 API:To use the Service Bus APIs:

  1. 使用 require_once 陳述式來參考自動換片器檔案。Reference the autoloader file using the require_once statement.
  2. 參考任何您可能使用的類別。Reference any classes you might use.

下列範例說明如何納入自動換片器檔案及參考 ServiceBusService 類別。The following example shows how to include the autoloader file and reference the ServiceBusService class.

注意

此範例 (和本文中的其他範例) 假設您已透過編輯器安裝 PHP Client Libraries for Azure。This example (and other examples in this article) assumes you have installed the PHP Client Libraries for Azure via Composer. 如果您以手動方式或以 PEAR 套件方式安裝程式庫,則必須參考 WindowsAzure.php 自動換片器檔案。If you installed the libraries manually or as a PEAR package, you must reference the WindowsAzure.php autoloader file.

require_once 'vendor/autoload.php';
use WindowsAzure\Common\ServicesBuilder;

在下列各範例中,一律會顯示 require_once 陳述式,但只會參考要執行之範例所需的類別。In the following examples, the require_once statement is always shown, but only the classes necessary for the example to execute are referenced.

設定服務匯流排連接Set up a Service Bus connection

若要具現化服務匯流排用戶端,您必須具備符合下列格式的有效連接字串:To instantiate a Service Bus client, you must first have a valid connection string in this format:

Endpoint=[yourEndpoint];SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[Primary Key]

其中,Endpoint 的格式通常是 https://[yourNamespace].servicebus.windows.netWhere Endpoint is typically of the format https://[yourNamespace].servicebus.windows.net.

若要建立任何 Azure 服務用戶端,您必須使用 ServicesBuilder 類別。To create any Azure service client, you must use the ServicesBuilder class. 您可以:You can:

  • 直接將連接字串傳遞給它。Pass the connection string directly to it.
  • 使用 CloudConfigurationManager (CCM) 到多種外部來源檢查連接字串:Use the CloudConfigurationManager (CCM) to check multiple external sources for the connection string:
    • 預設已支援一種外部來源,即環境變數。By default it comes with support for one external source - environmental variables.
    • 您可以擴充 ConnectionStringSource 類別以加入新來源。You can add new sources by extending the ConnectionStringSource class.

在本文的各範例中,將會直接傳遞連接字串。For the examples outlined here, the connection string is passed directly.

require_once 'vendor/autoload.php';

use WindowsAzure\Common\ServicesBuilder;

$connectionString = "Endpoint=[yourEndpoint];SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[Primary Key]";

$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);

建立主題Create a topic

您可以透過 ServiceBusRestProxy 類別來執行服務匯流排主題的管理作業。You can perform management operations for Service Bus topics via the ServiceBusRestProxy class. ServiceBusRestProxy 物件可透過 ServicesBuilder::createServiceBusService Factory 方法,使用含有權杖權限加以管理的適當連接字串來建構。A ServiceBusRestProxy object is constructed via the ServicesBuilder::createServiceBusService factory method with an appropriate connection string that encapsulates the token permissions to manage it.

下列範例將說明如何具現化 ServiceBusRestProxy 並呼叫 ServiceBusRestProxy->createTopic,以便在 MySBNamespace 命名空間內建立名為 mytopic 的主題:The following example shows how to instantiate a ServiceBusRestProxy and call ServiceBusRestProxy->createTopic to create a topic named mytopic within a MySBNamespace namespace:

require_once 'vendor/autoload.php';

use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\ServiceBus\Models\TopicInfo;

// Create Service Bus REST proxy.
$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);

try {
    // Create topic.
    $topicInfo = new TopicInfo("mytopic");
    $serviceBusRestProxy->createTopic($topicInfo);
}
catch(ServiceException $e){
    // Handle exception based on error codes and messages.
    // Error codes and messages are here: 
    // https://docs.microsoft.com/rest/api/storageservices/Common-REST-API-Error-Codes
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code.": ".$error_message."<br />";
}

注意

您可以在 ServiceBusRestProxy 物件上使用 listTopics 方法,檢查服務命名空間內是否已有指定名稱的主題存在。You can use the listTopics method on ServiceBusRestProxy objects to check if a topic with a specified name already exists within a service namespace.

建立訂用帳戶Create a subscription

ServiceBusRestProxy->createSubscription 方法也能用來建立主題訂用帳戶。Topic subscriptions are also created with the ServiceBusRestProxy->createSubscription method. 為訂閱命名,且能包含選擇性篩選器,以用來限制傳遞至訂閱的虛擬佇列的訊息集合。Subscriptions are named and can have an optional filter that restricts the set of messages passed to the subscription's virtual queue.

使用預設 (MatchAll) 篩選器建立訂用帳戶Create a subscription with the default (MatchAll) filter

如果在建立新的訂用帳戶時未指定篩選器,將會使用 MatchAll 篩選器 (預設)。If no filter is specified when a new subscription is created, the MatchAll filter (default) is used. 使用 MatchAll 篩選器時,所有發佈至主題的訊息都會被置於訂用帳戶的虛擬佇列中。When the MatchAll filter is used, all messages published to the topic are placed in the subscription's virtual queue. 下列範例將建立名為 mysubscription 的訂用帳戶,並使用預設的 MatchAll 篩選條件。The following example creates a subscription named mysubscription and uses the default MatchAll filter.

require_once 'vendor/autoload.php';

use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\ServiceBus\Models\SubscriptionInfo;

// Create Service Bus REST proxy.
$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);

try {
    // Create subscription.
    $subscriptionInfo = new SubscriptionInfo("mysubscription");
    $serviceBusRestProxy->createSubscription("mytopic", $subscriptionInfo);
}
catch(ServiceException $e){
    // Handle exception based on error codes and messages.
    // Error codes and messages are here: 
    // https://docs.microsoft.com/rest/api/storageservices/Common-REST-API-Error-Codes
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code.": ".$error_message."<br />";
}

使用篩選器建立訂用帳戶Create subscriptions with filters

您也可以設定篩選器,讓您指定傳送至主題的哪些訊息應出現在特定主題訂用帳戶中。You can also set up filters that enable you to specify which messages sent to a topic should appear within a specific topic subscription. 訂用帳戶所支援的最具彈性篩選器類型是實作 SQL92 子集的 SqlFilterThe most flexible type of filter supported by subscriptions is the SqlFilter, which implements a subset of SQL92. SQL 篩選器會對發佈至主題之訊息的屬性運作。SQL filters operate on the properties of the messages that are published to the topic. 如需 SqlFilters 的詳細資訊,請參閱 SqlFilter.SqlExpression 屬性For more information about SqlFilters, see SqlFilter.SqlExpression Property.

注意

訂用帳戶的每個規則可獨立處理傳入的訊息,並將其結果訊息新增至訂用帳戶。Each rule on a subscription processes incoming messages independently, adding their result messages to the subscription. 此外,每個新訂用帳戶都有具篩選器的預設 Rule 物件,而篩選器會將主題中的所有訊息新增至訂用帳戶。In addition, each new subscription has a default Rule object with a filter that adds all messages from the topic to the subscription. To receive only messages matching your filter, you must remove the default rule.To receive only messages matching your filter, you must remove the default rule. 您可以使用 ServiceBusRestProxy->deleteRule 方法以移除預設規則。You can remove the default rule by using the ServiceBusRestProxy->deleteRule method.

以下範例將建立名為 HighMessages 的訂用帳戶,而且所含的 SqlFilter 只會選取自訂 MessageNumber 屬性大於 3 的訊息。The following example creates a subscription named HighMessages with a SqlFilter that only selects messages that have a custom MessageNumber property greater than 3. 請參閱傳送訊息至主題,以取得將自訂屬性新增至訊息的相關資訊。See Send messages to a topic for information about adding custom properties to messages.

$subscriptionInfo = new SubscriptionInfo("HighMessages");
$serviceBusRestProxy->createSubscription("mytopic", $subscriptionInfo);

$serviceBusRestProxy->deleteRule("mytopic", "HighMessages", '$Default');

$ruleInfo = new RuleInfo("HighMessagesRule");
$ruleInfo->withSqlFilter("MessageNumber > 3");
$ruleResult = $serviceBusRestProxy->createRule("mytopic", "HighMessages", $ruleInfo);

此程式碼必須使用額外的命名空間:WindowsAzure\ServiceBus\Models\SubscriptionInfoThis code requires the use of an additional namespace: WindowsAzure\ServiceBus\Models\SubscriptionInfo.

同樣地,下列範例將建立名為 LowMessages 的訂用帳戶,而且所含的 SqlFilter 只會選取 MessageNumber 屬性小於或等於 3 的訊息。Similarly, the following example creates a subscription named LowMessages with a SqlFilter that only selects messages that have a MessageNumber property less than or equal to 3.

$subscriptionInfo = new SubscriptionInfo("LowMessages");
$serviceBusRestProxy->createSubscription("mytopic", $subscriptionInfo);

$serviceBusRestProxy->deleteRule("mytopic", "LowMessages", '$Default');

$ruleInfo = new RuleInfo("LowMessagesRule");
$ruleInfo->withSqlFilter("MessageNumber <= 3");
$ruleResult = $serviceBusRestProxy->createRule("mytopic", "LowMessages", $ruleInfo);

現在,當訊息傳送至 mytopic 主題時,一律會將該訊息傳遞至已訂閱 mysubscription 訂用帳戶的接收者,並選擇性地傳遞至已訂閱 HighMessagesLowMessages 訂用帳戶的接收者 (視訊息內容而定)。Now, when a message is sent to the mytopic topic, it is always delivered to receivers subscribed to the mysubscription subscription, and selectively delivered to receivers subscribed to the HighMessages and LowMessages subscriptions (depending upon the message content).

傳送訊息至主題Send messages to a topic

若要將訊息傳送至服務匯流排主題,應用程式會呼叫 ServiceBusRestProxy->sendTopicMessage 方法。To send a message to a Service Bus topic, your application calls the ServiceBusRestProxy->sendTopicMessage method. 下列程式碼示範如何將訊息傳送至先前在 MySBNamespace 服務命名空間中建立的 mytopic 主題。The following code shows how to send a message to the mytopic topic previously created within the MySBNamespace service namespace.

require_once 'vendor/autoload.php';

use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\ServiceBus\Models\BrokeredMessage;

// Create Service Bus REST proxy.
$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);

try {
    // Create message.
    $message = new BrokeredMessage();
    $message->setBody("my message");

    // Send message.
    $serviceBusRestProxy->sendTopicMessage("mytopic", $message);
}
catch(ServiceException $e){
    // Handle exception based on error codes and messages.
    // Error codes and messages are here: 
    // https://docs.microsoft.com/rest/api/storageservices/Common-REST-API-Error-Codes
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code.": ".$error_message."<br />";
}

傳送至服務匯流排主題的訊息是 BrokeredMessage 類別的執行個體。Messages sent to Service Bus topics are instances of the BrokeredMessage class. BrokeredMessage 物件具有一組標準屬性和方法,以及可用來保存自訂應用程式特定屬性的屬性。BrokeredMessage objects have a set of standard properties and methods, as well as properties that can be used to hold custom application-specific properties. 下列範例示範如何將五則測試訊息傳送至先前建立的 mytopic 主題。The following example shows how to send five test messages to the mytopic topic previously created. setProperty 方法會用來將自訂屬性 (MessageNumber) 新增至每個訊息。The setProperty method is used to add a custom property (MessageNumber) to each message. 每個訊息的 MessageNumber 屬性值有不同之處 (您可以使用此值來判斷哪些訂用帳戶會接收訊息,如建立訂用帳戶一節所述):The MessageNumber property value varies on each message (you can use this value to determine which subscriptions receive it, as shown in the Create a subscription section):

for($i = 0; $i < 5; $i++){
    // Create message.
    $message = new BrokeredMessage();
    $message->setBody("my message ".$i);

    // Set custom property.
    $message->setProperty("MessageNumber", $i);

    // Send message.
    $serviceBusRestProxy->sendTopicMessage("mytopic", $message);
}

服務匯流排主題支援的訊息大小上限:在標準層中為 256 KB 以及在進階層中為 1 MB。Service Bus topics support a maximum message size of 256 KB in the Standard tier and 1 MB in the Premium tier. 標頭 (包含標準和自訂應用程式屬性) 可以容納 64 KB 的大小上限。The header, which includes the standard and custom application properties, can have a maximum size of 64 KB. 主題中所保存的訊息數目沒有限制,但主題所保存的訊息大小總計會有最高限制。There is no limit on the number of messages held in a topic but there is a cap on the total size of the messages held by a topic. 主題大小的這項上限為 5 GB。This upper limit on topic size is 5 GB. 如需有關配額的詳細資訊,請參閱 服務匯流排配額For more information about quotas, see Service Bus quotas.

自訂用帳戶接收訊息Receive messages from a subscription

從訂用帳戶接收訊息的最佳方式是使用 ServiceBusRestProxy->receiveSubscriptionMessage 方法。The best way to receive messages from a subscription is to use a ServiceBusRestProxy->receiveSubscriptionMessage method. 可以兩種不同的模式接收訊息:ReceiveAndDeletePeekLockMessages can be received in two different modes: ReceiveAndDelete and PeekLock. PeekLock 是預設值。PeekLock is the default.

使用 ReceiveAndDelete 模式時,接收是一次性作業;也就是說,當服務匯流排在訂用帳戶中收到訊息的讀取要求時,它會將此訊息標示為已使用,並將它傳回應用程式。When using the ReceiveAndDelete mode, receive is a single-shot operation; that is, when Service Bus receives a read request for a message in a subscription, it marks the message as being consumed and returns it to the application. ReceiveAndDelete * 模式是最簡單的模型,且最適合可容許在發生失敗時不處理訊息的應用程式案例。ReceiveAndDelete * mode is the simplest model and works best for scenarios in which an application can tolerate not processing a message when a failure occurs. 若要了解這一點,請考慮取用者發出接收要求,接著系統在處理此要求之前當機的案例。To understand this, consider a scenario in which the consumer issues the receive request and then crashes before processing it. 因為服務匯流排已將訊息標示為已取用,所以,當應用程式重新啟動並開始重新取用訊息時,它會遺漏當機前已取用的訊息。Because Service Bus has marked the message as being consumed, then when the application restarts and begins consuming messages again, it has missed the message that was consumed prior to the crash.

在預設的 PeekLock 模式中,接收訊息會變成兩階段作業,因此可以支援無法容許遺漏訊息的應用程式。In the default PeekLock mode, receiving a message becomes a two stage operation, which makes it possible to support applications that cannot tolerate missing messages. 當服務匯流排收到要求時,它會尋找要取用的下一個訊息、將其鎖定以防止其他取用者接收此訊息,然後將它傳回應用程式。When Service Bus receives a request, it finds the next message to be consumed, locks it to prevent other consumers receiving it, and then returns it to the application. 在應用程式完成處理訊息 (或可靠地儲存此訊息以供未來處理) 之後,它會將已接收的訊息傳遞至 ServiceBusRestProxy->deleteMessage,以完成接收程序的第二個階段。After the application finishes processing the message (or stores it reliably for future processing), it completes the second stage of the receive process by passing the received message to ServiceBusRestProxy->deleteMessage. 當服務匯流排看到 deleteMessage 呼叫時,它會將訊息標示為已取用,並將它從佇列中移除。When Service Bus sees the deleteMessage call, it marks the message as being consumed and remove it from the queue.

下列範例說明如何使用 PeekLock 模式 (預設模式) 來接收與處理訊息。The following example shows how to receive and process a message using PeekLock mode (the default mode).

require_once 'vendor/autoload.php';

use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\ServiceBus\Models\ReceiveMessageOptions;

// Create Service Bus REST proxy.
$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);

try {
    // Set receive mode to PeekLock (default is ReceiveAndDelete)
    $options = new ReceiveMessageOptions();
    $options->setPeekLock();

    // Get message.
    $message = $serviceBusRestProxy->receiveSubscriptionMessage("mytopic", "mysubscription", $options);

    echo "Body: ".$message->getBody()."<br />";
    echo "MessageID: ".$message->getMessageId()."<br />";

    /*---------------------------
        Process message here.
    ----------------------------*/

    // Delete message. Not necessary if peek lock is not set.
    echo "Deleting message...<br />";
    $serviceBusRestProxy->deleteMessage($message);
}
catch(ServiceException $e){
    // Handle exception based on error codes and messages.
    // Error codes and messages are here:
    // https://docs.microsoft.com/rest/api/storageservices/Common-REST-API-Error-Codes
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code.": ".$error_message."<br />";
}

如何處理應用程式當機與無法讀取的訊息How to: handle application crashes and unreadable messages

服務匯流排提供一種功能,可協助您從應用程式的錯誤或處理訊息的問題中順利復原。Service Bus provides functionality to help you gracefully recover from errors in your application or difficulties processing a message. 如果接收者應用程式因為某些原因無法處理訊息,它可以在接收訊息上呼叫 unlockMessage 方法 (而不是 deleteMessage 方法)。If a receiver application is unable to process the message for some reason, then it can call the unlockMessage method on the received message (instead of the deleteMessage method). 這將導致服務匯流排將佇列中的訊息解除鎖定,讓此訊息可以被相同取用應用程式或其他取用應用程式重新接收。It causes Service Bus to unlock the message within the queue and make it available to be received again, either by the same consuming application or by another consuming application.

與在佇列內鎖定訊息相關的還有逾時,如果應用程式無法在鎖定逾時到期之前處理訊息 (例如,如果應用程式當機),則服務匯流排會自動解除鎖定訊息,並讓訊息可以被重新接收。There is also a timeout associated with a message locked within the queue, and if the application fails to process the message before the lock timeout expires (for example, if the application crashes), then Service Bus unlocks the message automatically and make it available to be received again.

如果應用程式在處理訊息之後,但尚未發出 deleteMessage 要求時當機,則會在應用程式重新啟動時將訊息重新傳遞給該應用程式。In the event that the application crashes after processing the message but before the deleteMessage request is issued, then the message is redelivered to the application when it restarts. 這種處理類型通常稱為至少處理一次,也就是說,每個訊息至少會被處理一次,但在特定狀況下,可能會重新傳遞相同訊息。This type of processing is often called at least once processing; that is, each message is processed at least once but in certain situations the same message may be redelivered. 如果案例無法容許重複處理,則應用程式開發人員應在應用程式中加入其他邏輯,以處理重複的訊息傳遞。If the scenario cannot tolerate duplicate processing, then application developers should add additional logic to applications to handle duplicate message delivery. 通常您可使用訊息的 getMessageId 方法來達到此目的,該方法在各個傳遞嘗試中保持不變。It is often achieved using the getMessageId method of the message, which remains constant across delivery attempts.

刪除主題和訂用帳戶Delete topics and subscriptions

若要刪除主題或訂用帳戶,請分別使用 ServiceBusRestProxy->deleteTopicServiceBusRestProxy->deleteSubscripton 方法。To delete a topic or a subscription, use the ServiceBusRestProxy->deleteTopic or the ServiceBusRestProxy->deleteSubscripton methods, respectively. 刪除主題也將會刪除對主題註冊的任何訂用帳戶。Deleting a topic also deletes any subscriptions that are registered with the topic.

下列範例示範如何刪除名為 mytopic 的主題及其註冊的訂用帳戶。The following example shows how to delete a topic named mytopic and its registered subscriptions.

require_once 'vendor/autoload.php';

use WindowsAzure\ServiceBus\ServiceBusService;
use WindowsAzure\ServiceBus\ServiceBusSettings;
use WindowsAzure\Common\ServiceException;

// Create Service Bus REST proxy.
$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);

try {
    // Delete topic.
    $serviceBusRestProxy->deleteTopic("mytopic");
}
catch(ServiceException $e){
    // Handle exception based on error codes and messages.
    // Error codes and messages are here: 
    // https://docs.microsoft.com/rest/api/storageservices/Common-REST-API-Error-Codes
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code.": ".$error_message."<br />";
}

使用 deleteSubscription 方法可讓您個別刪除某個訂用帳戶:By using the deleteSubscription method, you can delete a subscription independently:

$serviceBusRestProxy->deleteSubscription("mytopic", "mysubscription");

注意

您可以使用服務匯流排總管來管理服務匯流排資源。You can manage Service Bus resources with Service Bus Explorer. 服務匯流排總管可讓使用者連線到服務匯流排命名空間,並以簡便的方式管理傳訊實體。The Service Bus Explorer allows users to connect to a Service Bus namespace and administer messaging entities in an easy manner. 此工具提供進階的功能 (例如匯入/匯出功能) 或測試主題、佇列、訂用帳戶、轉送服務、通知中樞和事件中樞的能力。The tool provides advanced features like import/export functionality or the ability to test topic, queues, subscriptions, relay services, notification hubs and events hubs.

後續步驟Next steps

如需詳細資訊,請參閱佇列、主題和訂用帳戶For more information, see Queues, topics, and subscriptions.