Visitar URL original
[BUG] RabbitMQ events lack publisher confirms and persistence · Issue #2779 · evolution-foundation/evolution-api · GitHub
Skip to content

[BUG] RabbitMQ events lack publisher confirms and persistence #2779

Open

Description

@hugoalves-dev

📋 Bug Description

RabbitMQ events can be silently lost: the Evolution API publisher uses createChannel() (not a confirm channel) and await channel.publish(...) (which returns a flow-control boolean, not broker confirmation). Messages also lack persistent: true. This affects per-instance and global publishing. Code verified in 2.3.7, 2.4.0-rc2 and develop; runtime message loss was not measured.

🔄 Steps to Reproduce

  1. Inspect src/api/integrations/event/rabbitmq/rabbitmq.controller.ts in 2.3.7 or 2.4.0-rc2.
  2. Find connection.createChannel() and the two await this.amqpChannel.publish(...) calls.
  3. Note missing confirm channel, broker ACK handling, persistent: true, and durable recovery after failed publishing.
  4. An AMQP disconnect can cause emit() to skip publishing without later replay.

✅ Expected Behavior

Use a confirm channel; await broker ACK with timeout; publish persistent messages; handle NACK/unroutable messages and connection failures; test broker restarts without silent loss.

❌ Actual Behavior

Regular AMQP channel; publish() is awaited without broker ACK, persistence flag is absent, and retries/reconnections are limited. Durable queue != durable message.

🌍 Environment

  • Linux / Docker
  • Evolution API 2.3.7 (production), 2.4.0-rc2 (code inspected)
  • PostgreSQL, RabbitMQ 4.4.0, Baileys

📋 Logs

📝 Additional Context

Related: PR #1901 (publisher confirms + persistence, closed unmerged), PR #1898 (retries, closed unmerged), PR #1878 (reconnect, merged). Please revisit #1901. We currently use webhook -> Spring Boot -> RabbitMQ to retain broker confirmations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions