constructor( clientConfig: RabbitmqClientConfig, name: string, producerConfig: RabbitmqProducerConfig ) { super(clientConfig, name); this.producerConfig = {...producerConfig}; this.producerConfig.backPressureStrategy = producerConfig.backPressureStrategy || RabbitmqBackPressureStrategy.ERROR; this.logger = logger; this.publishDurationHistogram = rabbitmqPublishTime.labels(name); this.publishFailures = rabbitmqPublishErrorCounter.labels(name); }
constructor( clientConfig: RabbitmqClientConfig, name: string, consumerConfig: RabbitmqConsumerConfig, handler: RabbitmqConsumerHandler) { super(clientConfig, name); this.messageHandler = newrelic ? new NewrelichandlerWrapper(handler) : handler; this.consumerConfig = {...consumerConfig}; this.consumerConfig.options = this.consumerConfig.options || {}; this.logger = logger; this.consumeDurationHistogram = rabbitmqConsumeTime.labels(name); this.consumeFailures = rabbitmqConsumeErrorCounter.labels(name); this.consumeFailuresDLQ = rabbitmqConsumeDLQCounter.labels(name); this.consumeFailuresDelayed = rabbitmqConsumeDelayedCounter.labels(name); }