Created
September 9, 2021 13:34
-
-
Save Sraleik/13cf3c6b916c703e0eb2b007c37dff02 to your computer and use it in GitHub Desktop.
clever-pulsar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Pulsar from 'pulsar-client'; | |
(async () => { | |
const token = new Pulsar.AuthenticationToken({ token: 'fake-token' }) | |
const client = new Pulsar.Client({ | |
serviceUrl: 'pulsar+ssl://c2-pulsar-clevercloud-customers.services.clever-cloud.com:2002', | |
authentication: token, | |
}); | |
const producer = await client.createProducer({ | |
topic: 'persistent://user_5db919b8-f988-4c72-a269-f8d0f62cef22/pulsar_39f5266a-b0ab-4441-a787-18f897afa796/my-topic', | |
}); | |
const res = await producer.send({ | |
data: Buffer.from('test'), | |
}); | |
await client.close(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment