AiCPlayer
Interface of aic vm - for rendering aspect, sensors, video records
Functions
amqp_listen.h File Reference

Utilities for consuming RabbitMQ messages. More...

#include <amqp.h>
Include dependency graph for amqp_listen.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int amqp_listen_retry (const char *hostname, int port, const char *bindingkey, amqp_connection_state_t *conn, const unsigned int tries)
 Setup a consumer for a specific queue. More...
 
int amqp_consume (amqp_connection_state_t *conn, amqp_envelope_t *envelope)
 Consume one message from a connection object. More...
 

Detailed Description

Utilities for consuming RabbitMQ messages.

Definition in file amqp_listen.h.

Function Documentation

int amqp_consume ( amqp_connection_state_t *  conn,
amqp_envelope_t *  envelope 
)

Consume one message from a connection object.

Parameters
connThe connection object to use
envelopea preallocated envelope to store the message
Returns
-1 on failure
0 on success

Definition at line 90 of file amqp_listen.c.

Here is the caller graph for this function:

int amqp_listen_retry ( const char *  hostname,
int  port,
const char *  bindingkey,
amqp_connection_state_t *  conn,
const unsigned int  tries 
)

Setup a consumer for a specific queue.

Parameters
hostnameThe host of the RabbitMQ server
portThe port of the RabbitMQ server
bindingkeythe queue
connthe connection object to initialize
triesthe number of tries

This function will try to connect tries number of times, with a doubled delay everytimes something fails in the setup. In case of failure, it will log an error and terminate the program.

Definition at line 17 of file amqp_listen.c.

Here is the call graph for this function:

Here is the caller graph for this function: