Skip to content

Commit

Permalink
fix: ensure consumer tag is generated on creation of consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
AVVS committed Mar 25, 2022
1 parent fd27b86 commit 18464e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/amqp-coffee/src/lib/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export class Consumer extends Channel {
this._basicConsumePreflight = this._basicConsumePreflight.bind(this)
this._consumerStateOpenPreflight = this._consumerStateOpenPreflight.bind(this)
this._onConsumeError = this._onConsumeError.bind(this)

this.consumerTag = this.generateConsumerTag()
}

public async ready(): Promise<void> {
Expand All @@ -89,7 +91,6 @@ export class Consumer extends Channel {
}

public async consume(queueName: string, messageHandler: MessageHandler, options: ConsumeHandlerOpts = {}): Promise<BasicConsumeResponse> {
this.consumerTag = this.generateConsumerTag()
debug(2, () => `Consuming ${queueName} on channel ${this.channel}`)
this.consumerState = CONSUMER_STATES.CONSUMER_STATE_OPENING

Expand Down

0 comments on commit 18464e8

Please sign in to comment.