rabbitmq-c
0.2
C AMQP Client library for RabbitMQ
|
Go to the source code of this file.
Data Structures | |
struct | amqp_bytes_t |
Structure for holding a buffer and its size. More... | |
struct | amqp_decimal_t |
For holding a decimal value. More... | |
struct | amqp_table_t |
An AMQP Field Table. More... | |
struct | amqp_array_t |
An AMQP Field Array. More... | |
struct | amqp_field_value_t |
A field table value. More... | |
struct | amqp_table_entry_t |
An entry in a field-table. More... | |
struct | amqp_pool_blocklist_t |
A list of allocation blocks. More... | |
struct | amqp_pool_t |
A memory pool. More... | |
struct | amqp_method_t |
An amqp method. More... | |
struct | amqp_frame_t |
An AMQP frame. More... | |
struct | amqp_rpc_reply_t |
Reply from a RPC method on the broker. More... | |
struct | amqp_connection_info |
Parameters used to connect to the RabbitMQ broker. More... | |
Macros | |
#define | AMQP_EMPTY_BYTES amqp_empty_bytes |
#define | AMQP_EMPTY_TABLE amqp_empty_table |
#define | AMQP_EMPTY_ARRAY amqp_empty_array |
Typedefs | |
typedef int | amqp_boolean_t |
boolean type | |
typedef uint32_t | amqp_method_number_t |
Method number. | |
typedef uint32_t | amqp_flags_t |
Bitmask for flags. | |
typedef uint16_t | amqp_channel_t |
Channel type. | |
typedef struct amqp_connection_state_t_ * | amqp_connection_state_t |
connection state object | |
Enumerations | |
enum | amqp_field_value_kind_t { AMQP_FIELD_KIND_BOOLEAN = 't', AMQP_FIELD_KIND_I8 = 'b', AMQP_FIELD_KIND_U8 = 'B', AMQP_FIELD_KIND_I16 = 's', AMQP_FIELD_KIND_U16 = 'u', AMQP_FIELD_KIND_I32 = 'I', AMQP_FIELD_KIND_U32 = 'i', AMQP_FIELD_KIND_I64 = 'l', AMQP_FIELD_KIND_U64 = 'L', AMQP_FIELD_KIND_F32 = 'f', AMQP_FIELD_KIND_F64 = 'd', AMQP_FIELD_KIND_DECIMAL = 'D', AMQP_FIELD_KIND_UTF8 = 'S', AMQP_FIELD_KIND_ARRAY = 'A', AMQP_FIELD_KIND_TIMESTAMP = 'T', AMQP_FIELD_KIND_TABLE = 'F', AMQP_FIELD_KIND_VOID = 'V', AMQP_FIELD_KIND_BYTES = 'x' } |
Field value types. More... | |
enum | amqp_response_type_enum { AMQP_RESPONSE_NONE = 0, AMQP_RESPONSE_NORMAL, AMQP_RESPONSE_LIBRARY_EXCEPTION, AMQP_RESPONSE_SERVER_EXCEPTION } |
Response type. More... | |
enum | amqp_sasl_method_enum { AMQP_SASL_METHOD_PLAIN = 0 } |
SASL method type. More... | |
Functions | |
char const * | amqp_version (void) |
Gets the version of rabbitmq-c. | |
void | init_amqp_pool (amqp_pool_t *pool, size_t pagesize) |
Initializes a amqp_pool_t memory allocation pool. | |
void | recycle_amqp_pool (amqp_pool_t *pool) |
Recycles an amqp_pool_t memory allocation pool. | |
void | empty_amqp_pool (amqp_pool_t *pool) |
Destroys an amqp_pool_t memory allocation pool. | |
void * | amqp_pool_alloc (amqp_pool_t *pool, size_t amount) |
Allocates a block of memory from an amqp_pool_t memory pool. | |
void | amqp_pool_alloc_bytes (amqp_pool_t *pool, size_t amount, amqp_bytes_t *output) |
Allocates a block of memory from an amqp_pool_t to an amqp_bytes_t. | |
amqp_bytes_t | amqp_cstring_bytes (char const *cstr) |
Wraps a c string in an amqp_bytes_t. | |
amqp_bytes_t | amqp_bytes_malloc_dup (amqp_bytes_t src) |
Duplicates an amqp_bytes_t buffer. | |
amqp_bytes_t | amqp_bytes_malloc (size_t amount) |
Allocates a amqp_bytes_t buffer. | |
void | amqp_bytes_free (amqp_bytes_t bytes) |
Frees an amqp_bytes_t buffer. | |
amqp_connection_state_t | amqp_new_connection (void) |
Creates a new amqp_connection_state_t object. | |
int | amqp_get_sockfd (amqp_connection_state_t state) |
Gets the sockfd associated with the connection. | |
void | amqp_set_sockfd (amqp_connection_state_t state, int sockfd) |
Sets the sockfd associated with the connection. | |
int | amqp_tune_connection (amqp_connection_state_t state, int channel_max, int frame_max, int heartbeat) |
Tune various client-side connection parameters. | |
int | amqp_get_channel_max (amqp_connection_state_t state) |
Get the maximum number of channels the connection can handle. | |
int | amqp_destroy_connection (amqp_connection_state_t state) |
Destroys a connection object. | |
int | amqp_handle_input (amqp_connection_state_t state, amqp_bytes_t received_data, amqp_frame_t *decoded_frame) |
Handle input. | |
amqp_boolean_t | amqp_release_buffers_ok (amqp_connection_state_t state) |
Check to see if the connection is in a state it can release its internal buffers. | |
void | amqp_release_buffers (amqp_connection_state_t state) |
Release connect object internal buffers. | |
void | amqp_maybe_release_buffers (amqp_connection_state_t state) |
Release buffers if possible. | |
int | amqp_send_frame (amqp_connection_state_t state, amqp_frame_t const *frame) |
Send a frame to the broker. | |
int | amqp_table_entry_cmp (void const *entry1, void const *entry2) |
Compare two table entries. | |
int | amqp_open_socket (char const *hostname, int portnumber) |
Attempt to open a socket. | |
int | amqp_send_header (amqp_connection_state_t state) |
Send AMQP handshake to broker. | |
amqp_boolean_t | amqp_frames_enqueued (amqp_connection_state_t state) |
Checks to see if there are any incoming frames ready to be read. | |
int | amqp_simple_wait_frame (amqp_connection_state_t state, amqp_frame_t *decoded_frame) |
Waits for a single frame from the broker. | |
int | amqp_simple_wait_method (amqp_connection_state_t state, amqp_channel_t expected_channel, amqp_method_number_t expected_method, amqp_method_t *output) |
Waits for a specific method from the broker. | |
int | amqp_send_method (amqp_connection_state_t state, amqp_channel_t channel, amqp_method_number_t id, void *decoded) |
Sends a method to the broker. | |
amqp_rpc_reply_t | amqp_simple_rpc (amqp_connection_state_t state, amqp_channel_t channel, amqp_method_number_t request_id, amqp_method_number_t *expected_reply_ids, void *decoded_request_method) |
Sends a method to the broker and waits for a method response. | |
void * | amqp_simple_rpc_decoded (amqp_connection_state_t state, amqp_channel_t channel, amqp_method_number_t request_id, amqp_method_number_t reply_id, void *decoded_request_method) |
Sends a method to the broker and waits for a method reponse. | |
amqp_rpc_reply_t | amqp_get_rpc_reply (amqp_connection_state_t state) |
Get the last global amqp_rpc_reply. | |
amqp_rpc_reply_t | amqp_login (amqp_connection_state_t state, char const *vhost, int channel_max, int frame_max, int heartbeat, amqp_sasl_method_enum sasl_method,...) |
Login to the broker. | |
int | amqp_basic_publish (amqp_connection_state_t state, amqp_channel_t channel, amqp_bytes_t exchange, amqp_bytes_t routing_key, amqp_boolean_t mandatory, amqp_boolean_t immediate, struct amqp_basic_properties_t_ const *properties, amqp_bytes_t body) |
Publish a message to the broker. | |
amqp_rpc_reply_t | amqp_channel_close (amqp_connection_state_t state, amqp_channel_t channel, int code) |
Closes an channel. | |
amqp_rpc_reply_t | amqp_connection_close (amqp_connection_state_t state, int code) |
Closes the entire connection. | |
int | amqp_basic_ack (amqp_connection_state_t state, amqp_channel_t channel, uint64_t delivery_tag, amqp_boolean_t multiple) |
Acknowledges a message. | |
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) |
Do a basic.get. | |
int | amqp_basic_reject (amqp_connection_state_t state, amqp_channel_t channel, uint64_t delivery_tag, amqp_boolean_t requeue) |
Do a basic.reject. | |
amqp_boolean_t | amqp_data_in_buffer (amqp_connection_state_t state) |
Check to see if there is data left in the receive buffer. | |
char * | amqp_error_string (int err) |
Get the error string for the given error code. | |
int | amqp_decode_table (amqp_bytes_t encoded, amqp_pool_t *pool, amqp_table_t *output, size_t *offset) |
Deserializes an amqp_table_t from AMQP wireformat. | |
int | amqp_encode_table (amqp_bytes_t encoded, amqp_table_t *input, size_t *offset) |
Serializes an amqp_table_t to the AMQP wireformat. | |
void | amqp_default_connection_info (struct amqp_connection_info *parsed) |
Initialze an amqp_connection_info to default values. | |
int | amqp_parse_url (char *url, struct amqp_connection_info *parsed) |
Parse a connection URL. | |
Variables | |
const amqp_bytes_t | amqp_empty_bytes |
Empty bytes structure. | |
const amqp_table_t | amqp_empty_table |
Empty table structure. | |
const amqp_array_t | amqp_empty_array |
Empty table array structure. | |
#define AMQP_EMPTY_ARRAY amqp_empty_array |
#define AMQP_EMPTY_BYTES amqp_empty_bytes |
#define AMQP_EMPTY_TABLE amqp_empty_table |
Field value types.
AMQP_FIELD_KIND_BOOLEAN |
boolean type. 0 = false, 1 = true
|
AMQP_FIELD_KIND_I8 |
8-bit signed integer, datatype: int8_t |
AMQP_FIELD_KIND_U8 |
8-bit unsigned integer, datatype: uint8_t |
AMQP_FIELD_KIND_I16 |
16-bit signed integer, datatype: int16_t |
AMQP_FIELD_KIND_U16 |
16-bit unsigned integer, datatype: uint16_t |
AMQP_FIELD_KIND_I32 |
32-bit signed integer, datatype: int32_t |
AMQP_FIELD_KIND_U32 |
32-bit unsigned integer, datatype: uint32_t |
AMQP_FIELD_KIND_I64 |
64-bit signed integer, datatype: int64_t |
AMQP_FIELD_KIND_U64 |
64-bit unsigned integer, datatype: uint64_t |
AMQP_FIELD_KIND_F32 |
single-precision floating point value, datatype: float |
AMQP_FIELD_KIND_F64 |
double-precision floating point value, datatype: double |
AMQP_FIELD_KIND_DECIMAL |
amqp-decimal value, datatype: amqp_decimal_t |
AMQP_FIELD_KIND_UTF8 |
UTF-8 null-terminated character string, datatype: amqp_bytes_t. |
AMQP_FIELD_KIND_ARRAY |
field array (repeated values of another datatype. datatype: amqp_array_t |
AMQP_FIELD_KIND_TIMESTAMP |
64-bit timestamp. datatype uint64_t |
AMQP_FIELD_KIND_TABLE |
field table. encapsulates a table inside a table entry. datatype: amqp_table_t |
AMQP_FIELD_KIND_VOID |
empty entry |
AMQP_FIELD_KIND_BYTES |
unformatted byte string, datatype: amqp_bytes_t |
Response type.
int amqp_basic_ack | ( | amqp_connection_state_t | state, |
amqp_channel_t | channel, | ||
uint64_t | delivery_tag, | ||
amqp_boolean_t | multiple | ||
) |
Acknowledges a message.
Does a basic.ack on a received message
[in] | state | the connection object |
[in] | channel | the channel identifier |
[in] | delivery_tag | the delivery take of the message to be ack'd |
[in] | multiple | if true, ack all messages up to this delivery tag, if false ack only this delivery tag |
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 | ||
) |
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.
[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 |
int amqp_basic_publish | ( | amqp_connection_state_t | state, |
amqp_channel_t | channel, | ||
amqp_bytes_t | exchange, | ||
amqp_bytes_t | routing_key, | ||
amqp_boolean_t | mandatory, | ||
amqp_boolean_t | immediate, | ||
struct amqp_basic_properties_t_ const * | properties, | ||
amqp_bytes_t | body | ||
) |
Publish a message to the broker.
[in] | state | the connection object |
[in] | channel | the channel identifier |
[in] | exchange | the exchange on the broker to publish to |
[in] | routing_key | the routing key to use when publishing the message |
[in] | mandatory | indicate to the broker that the message MUST be routed to a queue. If the broker cannot do this it should respond with a basic.reject method. |
[in] | immediate | indicate to the broker that the message MUST be delivered to a consumer immediately. If the broker cannot do this it should response with a basic.reject method. |
[in] | properties | the properties associated with the message |
[in] | body | the message body |
int amqp_basic_reject | ( | amqp_connection_state_t | state, |
amqp_channel_t | channel, | ||
uint64_t | delivery_tag, | ||
amqp_boolean_t | requeue | ||
) |
Do a basic.reject.
Actively reject a message that has been delivered
[in] | state | the connection object |
[in] | channel | the channel identifier |
[in] | delivery_tag | the delivery tag of the message to reject |
[in] | requeue | indicate to the broker whether it should requeue the message or just discard it. |
void amqp_bytes_free | ( | amqp_bytes_t | bytes | ) |
Frees an amqp_bytes_t buffer.
Frees a buffer allocated with amqp_bytes_malloc or amqp_bytes_malloc_dup
Calling amqp_bytes_free on buffers not allocated with one of those two functions will result in undefined behavior
[in] | bytes | the buffer to free |
amqp_bytes_t amqp_bytes_malloc | ( | size_t | amount | ) |
Allocates a amqp_bytes_t buffer.
Creates an amqp_bytes_t buffer of the specified amount
[in] | amount | the size of the buffer in bytes |
amqp_bytes_t amqp_bytes_malloc_dup | ( | amqp_bytes_t | src | ) |
Duplicates an amqp_bytes_t buffer.
The buffer is cloned and the contents copied.
The memory associated with the output is allocated with amqp_bytes_malloc and should be freed with amqp_bytes_free
[in] | src |
amqp_rpc_reply_t amqp_channel_close | ( | amqp_connection_state_t | state, |
amqp_channel_t | channel, | ||
int | code | ||
) |
Closes an channel.
[in] | state | the connection object |
[in] | channel | the channel identifier |
[in] | code | the reason for closing the channel, AMQP_REPLY_SUCCESS is a good default |
amqp_rpc_reply_t amqp_connection_close | ( | amqp_connection_state_t | state, |
int | code | ||
) |
Closes the entire connection.
Implicitly closes all channels and informs the broker the connection is being closed, after receiving acknowldgement from the broker it closes the socket.
[in] | state | the connection object |
[in] | code | the reason code for closing the connection. AMQP_REPLY_SUCCESS is a good default. |
amqp_bytes_t amqp_cstring_bytes | ( | char const * | cstr | ) |
Wraps a c string in an amqp_bytes_t.
Takes a string, calculates its length and creates an amqp_bytes_t that points to it. The string is not duplicated.
For a given input cstr, The amqp_bytes_t output.bytes is the same as cstr, output.len is the length of the string not including the \0 terminator
This function uses strlen() internally so cstr must be properly terminated
[in] | cstr | the c string to wrap |
amqp_boolean_t amqp_data_in_buffer | ( | amqp_connection_state_t | state | ) |
Check to see if there is data left in the receive buffer.
Can be used to see if there is data still in the buffer, if so calling amqp_simple_wait_frame will not immediately enter a blocking read.
[in] | state | the connection object |
int amqp_decode_table | ( | amqp_bytes_t | encoded, |
amqp_pool_t * | pool, | ||
amqp_table_t * | output, | ||
size_t * | offset | ||
) |
Deserializes an amqp_table_t from AMQP wireformat.
This is an internal function and is not typically used by client applications
[in] | encoded | the buffer containing the serialized data |
[in] | pool | memory pool used to allocate the table entries from |
[in] | output | the amqp_table_t structure to fill in. Any existing entries will be erased |
[in,out] | offset | The offset into the encoded buffer to start reading the serialized table. It will be updated by this function to end of the table |
void amqp_default_connection_info | ( | struct amqp_connection_info * | parsed | ) |
Initialze an amqp_connection_info to default values.
The default values are:
[out] | parsed | the connection info to set defaults on |
int amqp_destroy_connection | ( | amqp_connection_state_t | state | ) |
Destroys a connection object.
Destroys a connection object created with amqp_new_connection This function will free all memory and close any sockets associated with the connection
[in] | state | the connection object |
int amqp_encode_table | ( | amqp_bytes_t | encoded, |
amqp_table_t * | input, | ||
size_t * | offset | ||
) |
Serializes an amqp_table_t to the AMQP wireformat.
This is an internal function and is not typically used by client applications
[in] | encoded | the buffer where to serialize the table to |
[in] | input | the amqp_table_t to serialize |
[in,out] | offset | The offset into the encoded buffer to start writing the serialized table. It will be updated by this function to where writing left off |
char* amqp_error_string | ( | int | err | ) |
Get the error string for the given error code.
The returned string resides on the heap; the caller is responsible for freeing it.
[in] | err | return error code |
amqp_boolean_t amqp_frames_enqueued | ( | amqp_connection_state_t | state | ) |
Checks to see if there are any incoming frames ready to be read.
If this function returns true, amqp_simple_wait_method will return a new frame without potentially entering a blocking read()
[in] | state | the connection object |
int amqp_get_channel_max | ( | amqp_connection_state_t | state | ) |
Get the maximum number of channels the connection can handle.
This number can be changed using the amqp_tune_connection function
[in] | state | the connection object |
amqp_rpc_reply_t amqp_get_rpc_reply | ( | amqp_connection_state_t | state | ) |
Get the last global amqp_rpc_reply.
The API methods corresponding to most synchronous AMQP methods return a pointer to the decoded method result. Upon error, they return NULL, and we need some way of discovering what, if anything, went wrong. amqp_get_rpc_reply() returns the most recent amqp_rpc_reply_t instance corresponding to such an API operation for the given connection.
Only use it for operations that do not themselves return amqp_rpc_reply_t; operations that do return amqp_rpc_reply_t generally do NOT update this per-connection-global amqp_rpc_reply_t instance.
[in] | state | the connection object |
int amqp_get_sockfd | ( | amqp_connection_state_t | state | ) |
Gets the sockfd associated with the connection.
[in] | state | the connection object |
int amqp_handle_input | ( | amqp_connection_state_t | state, |
amqp_bytes_t | received_data, | ||
amqp_frame_t * | decoded_frame | ||
) |
Handle input.
For a given input buffer and connection state potentially decode a frame from it
[in] | state | the connection object |
[in] | received_data | a buffer of the data to be decoded |
[in] | decoded_frame | the frame |
amqp_rpc_reply_t amqp_login | ( | amqp_connection_state_t | state, |
char const * | vhost, | ||
int | channel_max, | ||
int | frame_max, | ||
int | heartbeat, | ||
amqp_sasl_method_enum | sasl_method, | ||
... | |||
) |
Login to the broker.
After using amqp_open_socket and amqp_set_sockfd, call amqp_login to complete connecting to the broker
[in] | state | the connection object |
[in] | vhost | the virtual host on the broker. The default virtual host on most brokers is "/" |
[in] | channel_max | the maximum number of channels to request of the broker for this connection. 0 means no limit, this is a good default. |
[in] | frame_max | the maximum size of an AMQP frame on the wire to request of the broker for this connection. 4096 is the minimum size, 2^31-1 is the maximum, a good default is 131072 (128KB). |
[in] | heartbeat | the number of seconds between heartbeat frames to request of the broker. A value of 0 disables heartbeats. NOTE: rabbitmq-c does not support heartbeats, your best bet is not to implement this. |
[in] | sasl_method | the SASL method to authenticate with the broker. followed by the authentication information. For AMQP_SASL_METHOD_PLAIN, the AMQP_SASL_METHOD_PLAIN should be followed by two arguments in this order: const char* username, and const char* password. |
void amqp_maybe_release_buffers | ( | amqp_connection_state_t | state | ) |
Release buffers if possible.
Releases interal connection buffers if it is possible
[in] | state | the connection object |
amqp_connection_state_t amqp_new_connection | ( | void | ) |
Creates a new amqp_connection_state_t object.
amqp_connection_state_t objects created with this function should be freed with amqp_destroy_connection
int amqp_open_socket | ( | char const * | hostname, |
int | portnumber | ||
) |
Attempt to open a socket.
Attempts to open a socket to hostname on portnumber
[in] | hostname | this can be a hostname or IP address. Both IPv4 and IPv6 are acceptable |
[in] | portnumber | the port to connect on. RabbitMQ brokers listen on port 5672, and 5671 for SSL |
int amqp_parse_url | ( | char * | url, |
struct amqp_connection_info * | parsed | ||
) |
Parse a connection URL.
An amqp connection url takes the form:
amqp://[$USERNAME[:$PASSWORD]@]$HOST[:$PORT]/[$VHOST]
Examples: amqp://guest:guest@localhost:5672// amqp://guest:guest@localhost/myvhost
[in] | url | URI to parse |
[out] | parsed | the connection info gleaned from the URI |
void* amqp_pool_alloc | ( | amqp_pool_t * | pool, |
size_t | amount | ||
) |
Allocates a block of memory from an amqp_pool_t memory pool.
[in] | pool | the allocation pool to allocate the memory from |
[in] | amount | the size of the allocation in bytes |
void amqp_pool_alloc_bytes | ( | amqp_pool_t * | pool, |
size_t | amount, | ||
amqp_bytes_t * | output | ||
) |
Allocates a block of memory from an amqp_pool_t to an amqp_bytes_t.
[in] | pool | the allocation pool to allocate the memory from |
[in] | amount | the size of the allocation in bytes |
[in] | output | the location to store the pointer. On success output.bytes will be set to the beginning of the buffer output.len will be set to amount On error output.bytes will be set to NULL and output.len set to 0 |
void amqp_release_buffers | ( | amqp_connection_state_t | state | ) |
Release connect object internal buffers.
Call amqp_release_buffers_ok before calling this to ensure the connection is in a state that it can release the buffers. failing to do this will cause the program to abort.
[in] | state | the connection object |
amqp_boolean_t amqp_release_buffers_ok | ( | amqp_connection_state_t | state | ) |
Check to see if the connection is in a state it can release its internal buffers.
Call this to check before calling amqp_release_buffers.
Alternatively call amqp_maybe_release_buffers to do this all in one step
[in] | state | the connection object |
int amqp_send_frame | ( | amqp_connection_state_t | state, |
amqp_frame_t const * | frame | ||
) |
Send a frame to the broker.
[in] | state | the connection object |
[in] | frame | the frame to send to the broker |
int amqp_send_header | ( | amqp_connection_state_t | state | ) |
Send AMQP handshake to broker.
[in] | state | the connection object |
int amqp_send_method | ( | amqp_connection_state_t | state, |
amqp_channel_t | channel, | ||
amqp_method_number_t | id, | ||
void * | decoded | ||
) |
Sends a method to the broker.
[in] | state | the connection object |
[in] | channel | the channel object |
[in] | id | the method number |
[in] | decoded | the method object |
void amqp_set_sockfd | ( | amqp_connection_state_t | state, |
int | sockfd | ||
) |
Sets the sockfd associated with the connection.
[in] | state | the connection object |
[in] | sockfd | the socket |
amqp_rpc_reply_t amqp_simple_rpc | ( | amqp_connection_state_t | state, |
amqp_channel_t | channel, | ||
amqp_method_number_t | request_id, | ||
amqp_method_number_t * | expected_reply_ids, | ||
void * | decoded_request_method | ||
) |
Sends a method to the broker and waits for a method response.
[in] | state | the connection object |
[in] | channel | the channel object |
[in] | request_id | the method number of the request |
[in] | expected_reply_ids | a 0 terminated array of expected response method numbers |
[in] | decoded_request_method | the method to be sent to the broker |
void* amqp_simple_rpc_decoded | ( | amqp_connection_state_t | state, |
amqp_channel_t | channel, | ||
amqp_method_number_t | request_id, | ||
amqp_method_number_t | reply_id, | ||
void * | decoded_request_method | ||
) |
Sends a method to the broker and waits for a method reponse.
[in] | state | the connection object |
[in] | channel | the channel object |
[in] | request_id | the method number of the request |
[in] | reply_id | the method number expected in response |
[in] | decoded_request_method | the request method |
int amqp_simple_wait_frame | ( | amqp_connection_state_t | state, |
amqp_frame_t * | decoded_frame | ||
) |
Waits for a single frame from the broker.
[in] | state | the connection object |
[out] | decoded_frame | the frame |
int amqp_simple_wait_method | ( | amqp_connection_state_t | state, |
amqp_channel_t | expected_channel, | ||
amqp_method_number_t | expected_method, | ||
amqp_method_t * | output | ||
) |
Waits for a specific method from the broker.
Waits for a single method on a channel from the broker. If a frame is received that does not match expected_channel or expected_method the program will abort
[in] | state | the connection object |
[in] | expected_channel | the channel that the method should be delivered on |
[in] | expected_method | the method to wait for |
[out] | output | the method |
int amqp_table_entry_cmp | ( | void const * | entry1, |
void const * | entry2 | ||
) |
Compare two table entries.
Works just like strcmp(), comparing two the table keys, datatype, then values
[in] | entry1 | the entry on the left |
[in] | entry2 | the entry on the right |
int amqp_tune_connection | ( | amqp_connection_state_t | state, |
int | channel_max, | ||
int | frame_max, | ||
int | heartbeat | ||
) |
Tune various client-side connection parameters.
[in] | state | the connection object |
[in] | channel_max | the maximum number of channels. The largest this can be is 65535 |
[in] | frame_max | the maximum size of an frame. The smallest this can be is 4096 The largest this can be is 2147483647 Unless you know what you're doing the recommended size is 131072 |
[in] | heartbeat | the number of seconds between heartbeats NOTE: rabbitmq-c does not support heartbeats, setting this will not have any effect |
char const* amqp_version | ( | void | ) |
Gets the version of rabbitmq-c.
void empty_amqp_pool | ( | amqp_pool_t * | pool | ) |
Destroys an amqp_pool_t memory allocation pool.
This is a frees all memory associated with an amqp_pool_t
[in] | pool | the amqp_pool_t to empty |
void init_amqp_pool | ( | amqp_pool_t * | pool, |
size_t | pagesize | ||
) |
Initializes a amqp_pool_t memory allocation pool.
Readies an allocation pool for use. An amqp_pool_t must be initialized before use
[in] | pool | the amqp_pool_t structure to initialize. Calling this function on a pool a pool that has already been initialized will result in undefined behavior |
[in] | pagesize | the unit size that the pool will allocate memory chunks in. Anything allocated against the pool with a requested size will be carved out of a block this size. Allocations larger than this will be allocated individually |
void recycle_amqp_pool | ( | amqp_pool_t * | pool | ) |
Recycles an amqp_pool_t memory allocation pool.
Recycles the space allocate by the pool
This invalidates all allocations made against the pool before the call was made. Use of those pointers will have undefined behavior.
Note: this may or may not release memory, if you're looking to free memory try using empty_amqp_pool
[in] | pool | the amqp_pool_t to recycle |