Skip to content

No publisher confirms — silent message drops on broker rejection #28

@iifawzi

Description

@iifawzi

Summary

RabbitMQClientChannel.publish returns true immediately. There are no publisher confirms anywhere in the codebase. If RabbitMQ rejects the message (mandatory-routed with no queue, alarm state, exchange missing), the caller never knows — runMQ.publish() resolves successfully and the message is gone.

Where

  • src/core/clients/RabbitMQClientChannel.ts:109-128
  • src/core/publisher/producers/RunMQBaseProducer.ts:11-26

Current code

publish(...): boolean {
    this.channel.basicPublish({...}, content);
    return true;  // always
}

Failure mode

  • Misconfigured exchange/binding → silent drop.
  • Broker memory alarm → silent drop.
  • Channel closed mid-publish → silent drop.

Proposed fix

  • Use confirmSelect on publishing channels.
  • Make publish() async and await waitForConfirms() (or use a per-publish confirm callback).
  • Consider mandatory + return listener for unroutable messages.

Note

This is the foundation for #19 (DLQ confirms). Best done together — DLQ publishes are the most safety-critical and should be the first to use confirms; user-publish path should follow.

Acceptance criteria

  • Publishes that the broker rejects produce a thrown error or rejected promise.
  • Test: publish to a non-existent exchange → caller sees the failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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