Slackbot
07/10/2023, 1:10 PMAndy Walker
07/10/2023, 2:04 PMojoxdan
07/10/2023, 2:30 PMimport * as Pulsar from "pulsar-client";
class PulsarClient {
public pc: any;
public pulsarURL =
"string";
public pulsarJWT =
"string"
public pulsarTopic = "string";
public subscriptionName = "sample";
constructor() {
const authentication = new Pulsar.AuthenticationToken({
token: this.pulsarJWT,
});
this.pc = new Pulsar.Client({
serviceUrl: this.pulsarURL,
authentication,
});
}
async consumer() {}
async producer(payload: any) {
const producer = await this.pc.createProducer({
topic: this.pulsarTopic,
// topic: topic,÷
});
producer.send({
data:"data",
});
}
}
export default PulsarClient;ojoxdan
07/10/2023, 2:33 PMInitialize I don't know if you are familiar with the app engine