Function amqp_basic_get

Synopsis

#include <librabbitmq/amqp.h>

amqp_rpc_reply_t amqp_basic_get(amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t queue, amqp_boolean_t no_ack)

Description

Do a basic.get

Synchonously polls the broker for a message in a queue, and retrieves the message if a message is in the queue.

Parameters:

[ in ] state - the connection object

[ in ] channel - the channel identifier to use

[ in ] queue - the queue name to retrieve from

[ in ] no_ack - if true the message is automatically ack'ed if false amqp_basic_ack should be called once the message retrieved has been processed

Return
amqp_rpc_reply indicating success or failure
Since
v0.1

Source

Lines 328-341 in librabbitmq/amqp_api.c. Line 1987 in librabbitmq/amqp.h.

amqp_rpc_reply_t amqp_basic_get(amqp_connection_state_t state,
                                amqp_channel_t channel, amqp_bytes_t queue,
                                amqp_boolean_t no_ack) {
  amqp_method_number_t replies[] = {AMQP_BASIC_GET_OK_METHOD,
                                    AMQP_BASIC_GET_EMPTY_METHOD, 0};
  amqp_basic_get_t req;
  req.ticket = 0;
  req.queue = queue;
  req.no_ack = no_ack;

  state->most_recent_api_result =
      amqp_simple_rpc(state, channel, AMQP_BASIC_GET_METHOD, replies, &req);
  return state->most_recent_api_result;
}





Add Discussion as Guest

Log in to DocsForge