Overview
TDMQ for Apache Pulsar 2.7.1 and above clusters already support Apache Pulsar SDK for Node.js. This document describes how to access the SDK.
Prerequisites
Get the access address
Copy the access address on the Cluster Management page in the TDMQ for Apache Pulsar console. Get the token
Configure the role and permission as instructed in Role and Authentication and get the token of the role. Directions
$ npm install pulsar-client
2. In the code for creating the Node.js client, configure the prepared access address and token.
const Pulsar = require('pulsar-client');
(async () => {
const client = new Pulsar.Client({
serviceUrl: 'http://*', // Replace with the access address (copied from the **Cluster Management** page in the console)
authentication: Pulsar.NewAuthenticationToken("eyJh**"), // Replace with the token
});
await client.close();
})();
Was this page helpful?