Skip to content

defaultChannel shared between setup operations and publish() path #30

@iifawzi

Description

@iifawzi

Summary

getDefaultChannel() returns the same channel used for assertQueue / bindQueue / assertExchange AND for the public runMQ.publish() path. If a setup operation precondition-fails (e.g., a queue redeclare with mismatched args), RabbitMQ closes the channel — and that's also the channel publishes go through. Subsequent publishes silently fail or throw on a closed channel.

Where

  • src/core/RunMQ.ts:137-140 (initialize() uses defaultChannel for setup + holds it for publishes)
  • src/core/consumer/RunMQConsumerCreator.ts:94, 142 (assertQueues / bindQueues use defaultChannel)
  • src/core/clients/RabbitMQClientAdapter.ts:99-104 (getDefaultChannel)

Failure mode

Proposed fix

Acceptance criteria

  • Setup-time channel close does not affect the publishing channel.
  • Test: induce a queue-redeclare precondition failure → publish path remains healthy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    resilienceResilience / failure-mode issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions