Spring AMQP Consumer Fails to Declare Queue after RabbitMQ 4.0 Upgrade
search cancel

Spring AMQP Consumer Fails to Declare Queue after RabbitMQ 4.0 Upgrade

book

Article ID: 446695

calendar_today

Updated On:

Products

VMware Tanzu RabbitMQ

Issue/Introduction

Symptoms

  • The Tanzu RabbitMQ broker is successfully upgraded to version 4.0.x.
  • Client applications using Spring AMQP / Spring Boot fail to start up their listener threads.
  • The RabbitMQ Management UI shows 0 Consumers attached to the affected queue, and messages remain stuck in a Ready state.
  • Restaging or restarting the application does not resolve the issue.
  • The application logs continuously repeat the following warning:
JSON

{"Level":"WARN","File":"BlockingQueueConsumer.java","Message":"Failed to declare queue: <queue_name>"}

 

Environment

  • Product: VMware Tanzu RabbitMQ Version: 4.0.15
  • Erlang Runtime: Erlang/OTP 27 [erts-15.2.7.1]
  • Target Queue Type: Classic Queue (classic)

Cause

This behavior is caused by a version and configuration mismatch between the application client's targeted profile/health check configuration (expecting RabbitMQ 3.13.x behavior) and the actual broker version (4.0.x).

RabbitMQ 4.0 introduces internal architectural changes to metadata handling, classic queue storage, and stricter argument checking. If the client application passes legacy arguments or expects a schema specific to 3.13.x during its passive declaration phase, the broker rejects the channel connection. This causes Spring’s BlockingQueueConsumer thread to terminate before it can establish a stable consumer link.

Resolution

  1. Align Configuration Versioning: Review the application's configuration files (application.yml / application.properties) and health check parameters. Ensure that the properties and health check profiles target RabbitMQ version 4.0.x rather than an older release.
  2. Review Queue Arguments: Verify that any queue arguments defined in the Spring application code (e.g., via @Bean Queue) precisely match the arguments and features configured on the existing broker queue.

Additional Information

References

  • Spring AMQP Framework Documentation: * Reference: Review the Spring AMQP Reference Guide regarding BlockingQueueConsumer behavior and the attemptPassiveDeclarations startup loop.
    • Details: If a broker rejects a channel operation during passive initialization (such as an argument/feature constraint failure), Spring’s listener container drops the channel by design to prevent data corruption, resulting in zero consumers.
  • RabbitMQ 4.0 Release Notes & Breaking Changes: Review  RabbitMQ 4.0 Release Notes and RabbitMQ Classic Queues Configuration Guide.
    • Details: RabbitMQ 4.0 completely dropped Classic Queue Version 1 (CQv1) backend structures and legacy metadata plugins/management structures used in 3.13.x and earlier. Client health checks or application driver profiles hardcoded or configured to expect old 3.13.x topologies/arguments will fail during strict passive evaluation on a 4.0.x broker.