queue_declare
Declares a queue on the AMQP broker with specified persistence and deletion settings, ensuring a connection is active before execution. It outputs the queue status including message and consumer counts to the console and handles reconnection on failure.
def queue_declare(
amqp_context: object,
queue: string,
passive: boolean,
durable: boolean,
auto_delete: boolean
) - > null
Declares a queue on the AMQP broker, creating it if it does not exist or verifying its existence if the passive flag is set.
Parameters
| Name | Type | Description |
|---|---|---|
| amqp_context | object | The context object containing the active AMQP channel and CLI configuration. |
| queue | string | The name of the queue to declare or verify. |
| passive | boolean | If true, the server will only check if the queue exists; if it does not, an error is raised. |
| durable | boolean | If true, the queue will survive broker restarts. |
| auto_delete | boolean | If true, the queue will be deleted automatically when all consumers have finished using it. |
Returns
| Type | Description |
|---|---|
null | This function does not return a value but outputs the queue status (message and consumer counts) to the console. |