How to use the pulsar-client.AuthenticationTls function in pulsar-client

To help you get started, we’ve selected a few pulsar-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / pulsar-client-node / examples / producer_tls_auth.js View on Github external
(async () => {
  const auth = new Pulsar.AuthenticationTls({
    certificatePath: '/path/to/client.crt',
    privateKeyPath: '/path/to/client.key',
  });

  // Create a client
  const client = new Pulsar.Client({
    serviceUrl: 'pulsar+ssl://localhost:6651',
    authentication: auth,
    tlsTrustCertsFilePath: '/path/to/server.crt',
  });

  // Create a producer
  const producer = await client.createProducer({
    topic: 'persistent://public/default/my-topic',
  });
github apache / pulsar-client-node / examples / consumer_tls_auth.js View on Github external
(async () => {
  const auth = new Pulsar.AuthenticationTls({
    certificatePath: '/path/to/client.crt',
    privateKeyPath: '/path/to/client.key',
  });

  // Create a client
  const client = new Pulsar.Client({
    serviceUrl: 'pulsar+ssl://localhost:6651',
    authentication: auth,
    tlsTrustCertsFilePath: '/path/to/server.crt',
  });

  // Create a consumer
  const consumer = await client.subscribe({
    topic: 'persistent://public/default/my-topic',
    subscription: 'sub1',
    subscriptionType: 'Shared',

pulsar-client

Pulsar Node.js client

Apache-2.0
Latest version published 9 days ago

Package Health Score

81 / 100
Full package analysis

Similar packages