dist/connector/AmqpConnector.js
/**
     * Initializes the connector by creating a new connection to the amqp host set via config and creating a new queue to receive messages from
     */
Initializes the connector by creating a new connection to the amqp host set via config and creating a new queue to receive messages from
Initializes the connector by creating a new connection to the amqp host set via config and creating a new queue to receive messages from
async initialize() {
        this.client = await amqplib_1.default.connect(this.options.amqpUrl);
        this.channel = await this.client.createChannel();
        this.ready = true;
        this.channel.assertQueue(this.options.amqpQueue, { durable: false, autoDelete: true });
        this.channel.consume(this.options.amqpQueue, (event) => {
            var _a;
            if (event)
                (_a = this.channel) === null || _a === void 0 ? void 0 : _a.ack(event);
            if (event)
                this.emit("event", JSON.parse(event.content.toString()));
        });
    }
async initialize ( ) { this . client = await amqplib_1 . default . connect ( this . options . amqpUrl ) ; this . channel = await this . client . createChannel ( ) ; this . ready = true ; this . channel . assertQueue ( this . options . amqpQueue , { durable : false , autoDelete : true } ) ; this . channel . consume ( this . options . amqpQueue , ( event ) => { var _a ; if ( event ) ( _a = this . channel ) === null || _a === void 0 ? void 0 : _a . ack ( event ) ; if ( event ) this . emit ( "event" , JSON . parse ( event . content . toString ( ) ) ) ; } ) ; }
Initializes the connector by creating a new connection to the amqp host set via config and creating a new queue to receive messages from
Initializes the connector by creating a new connection to the amqp host set via config and creating a new queue to receive messages from
// console.log(event.content.toString());