basic_get
Retrieves a single message from a specified AMQP queue and outputs the result, handling reconnections if the channel is unavailable or an error occurs.
def basic_get(
amqp_context: object,
queue: string,
no_ack: boolean = False
) - > null
Fetches a single message from a specified queue on the AMQP broker. This function is used to manually poll for messages and will attempt to reconnect to the broker if the channel is unavailable or an error occurs during retrieval.
Parameters
| Name | Type | Description |
|---|---|---|
| amqp_context | object | The context object containing the active AMQP channel, connection state, and output methods. |
| queue | string | The name of the AMQP queue from which to retrieve the message. |
| no_ack | boolean = False | If set to True, the broker will consider the message acknowledged immediately upon delivery; if False, the client must send an explicit acknowledgement later. |
Returns
| Type | Description |
|---|---|
null | Returns nothing directly; outputs the dumped message content and a success status to the context's response handler. |