Skip to content

Comments

Add missing QUEUE_TYPE for rabbit_mqtt_qos0_queue#15524

Draft
MarcialRosales wants to merge 2 commits intomainfrom
add-missing-qos0-queue-type-to-mgt-ui
Draft

Add missing QUEUE_TYPE for rabbit_mqtt_qos0_queue#15524
MarcialRosales wants to merge 2 commits intomainfrom
add-missing-qos0-queue-type-to-mgt-ui

Conversation

@MarcialRosales
Copy link
Contributor

@MarcialRosales MarcialRosales commented Feb 20, 2026

This PR has two changes relative to the management ui.

  1. This change is not strictly required for OSS RabbitMQ, because there get_queue_type falls back to classic when the queue type is not classic, quorum, or stream. In Tanzu RabbitMQ, by contrast, get_queue_type returns the actual queue type with no such fallback, so queue types like rabbit_mqtt_qos0_queue are not treated as classic and the UI would try to render them without a default. The fallback to the classic get-message template is what makes those queue types render correctly in Tanzu.

  2. Use classic-queue-get-message template when get_message action is enabled and not template was configured.
    This code keeps backward compatibility with how the get-message UI used to work. Originally, the queue page (queue.ejs) contained the get-message HTML inline. It has since been moved into a separate template that is selected via the queue type’s QueueType.tmpl.get_message attribute.
    Some plugins outside rabbitmq-server were written for the old behaviour: they enable the get-message action but never set a get-message template, because the UI was always present. The RabbitMQ Delayed Message plugin is one example: it enables the get-message action but does not declare get_message on its queue type. With this fallback, such queue types still get a template (the classic-queue get-message template) and the UI continues to work without requiring those plugins to be updated.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

This change is not absolutely required for OSS RabbitMQ
because the function get_queue_type returns classic if the
queue type is not classic, quorum or stream.
however, in Tanzu, get_queue_type returns the raw type without
any default behavaiour hence rabbit_mqtt_qos0_queue types fail
to render.
@MarcialRosales MarcialRosales self-assigned this Feb 20, 2026
when get_message action is enabled and not template was configured.
This code is necessary for backward comppatibilities because in the
past the queue.ejs template had inline get_message html code. However
very recently, that html chunk is now delivered from a separate template
configured in the QueueType.tmpl.get_message attribute.

It can happen that plugins outside from rabbitmq-server rely on the
previous behaviour, i.e. get_message section was already in place and
they did not have configure any.
For instance, rabbitmq_delayed_message plugin has get_message action
enabled but it does not have the get_message template declared on its
queue type. Thanks to this code, it will have a template.
Comment on lines +1004 to +1008
policy_apply_to: "rabbit_mqtt_qos0_queue",
actions: {
get_message: true,
purge: true
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the MQTT QoS 0 queue type does not support policies. Neither can messages be received from this queue type via the Management UI nor can this queue type be purged.

@deadtrickster
Copy link
Contributor

I think you can just remove that "if" for DQ. ping me once this pr is merged and I will update DQ's stuff (copy paste that classic queue template).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants