This message was deleted.
# general
s
This message was deleted.
a
Without code, it's tough to say, however it seems like this might be an execution context problem: https://stackoverflow.com/questions/37307415/output-eventemitter-is-always-undefined
o
@Andy Walker Here is my code
Copy code
import * 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;
@Andy Walker then I am instantiating the class in the a rocket chat life cycle method called
Initialize
I don't know if you are familiar with the app engine