v.21.6Improvement

Add RabbitMQ Queue Settings and Cleanup on Table Drop

Allow to add specific queue settings via table settng rabbitmq_queue_settings_list. (Closes #23737 and #23918). Allow user to control all RabbitMQ setup: if table setting rabbitmq_queue_consume is set to 1 - RabbitMQ table engine will only connect to specified queue and will not perform any RabbitMQ consumer-side setup like declaring exchange, queues, bindings. (Closes #21757). Add proper cleanup when RabbitMQ table is dropped - delete queues, which the table has declared and all bound exchanges - if they were created by the table. #23887 (Kseniia Sumarokova).
Enhances the RabbitMQ table engine by allowing users to specify detailed queue settings via the rabbitmq_queue_settings_list table setting, control queue consumption behavior, and ensure proper cleanup of RabbitMQ resources when tables are dropped.

Why it matters

This feature addresses the need for finer control over RabbitMQ integration within ClickHouse. By enabling specific queue configurations and selective consumption settings, it prevents automatic consumer-side setup when not desired and allows managing exchanges, queues, and bindings precisely. Additionally, it ensures that resources created by the RabbitMQ table engine are properly cleaned up upon table deletion, helping users maintain a clean and predictable RabbitMQ environment.

How to use it

To use this feature, set the rabbitmq_queue_settings_list table setting to provide specific queue configurations. If you want the table engine to connect only to a specified queue without performing consumer-side setup (like declaring exchanges or bindings), set the rabbitmq_queue_consume table setting to 1. When dropping a RabbitMQ table, the engine will automatically remove queues and exchanges that it created.