適用於 Node.js 的 Azure 服務匯流排模組Azure Service Bus Modules for Node.js

Azure 服務匯流排是非同步的訊息雲端平台,可讓您在彼此分離的系統之間傳送資料。Azure Service Bus is an asynchronous messaging cloud platform that enables you to send data between decoupled systems.

深入了解 Azure 服務匯流排Learn more about Azure Service Bus.

管理封裝Management package

安裝 npm 模組Install the npm module

使用 npm 來安裝適用於 Node.js 的 Azure 服務匯流排模組Use npm to install the Azure Service Bus module for Node.js

npm install azure-arm-sb

範例Example

此範例會建立用戶端,然後列出所有與指定之訂用帳戶相關聯的服務匯流排命名空間。This example creates a client and then lists all Service Bus namespaces associated with a given subscription.

const msRestAzure = require('ms-rest-azure');
const ServicebusManagement = require('azure-arm-sb');

const subscriptionId = 'your-subscription-id';

msRestAzure.interactiveLogin().then(credentials => {
    const client = new ServicebusManagement(credentials, subscriptionId);
    client.namespaces.listBySubscription().then(namespaces => {
        namespaces.map(ns => {
            console.log(`found ns : ${ns.name}`);
        });
    });
});

範例Samples

深入探索可在應用程式中使用的 Node.js 程式碼範例Explore more sample Node.js code you can use in your apps.