37#define N_KAFKA_EVENT_QUEUED 0
39#define N_KAFKA_EVENT_WAITING_ACK 1
41#define N_KAFKA_EVENT_ERROR 2
43#define N_KAFKA_EVENT_OK 4
45#define N_KAFKA_EVENT_CREATED 5
80 rd_kafka_topic_partition_list_t *subscription;
124 N_KAFKA *
n_kafka_new( int64_t poll_timeout , int64_t poll_interval ,
size_t errstr_len );
Structure of a generic LIST container.
cJSON * configuration
kafka json configuration holder
pthread_t pooling_thread
pooling thread id
int mode
kafka handle mode: RD_KAFKA_CONSUMER or RD_KAFKA_PRODUCER
int64_t poll_timeout
poll timeout in usecs
int schema_id
kafka schema_id
rd_kafka_topic_t * rd_kafka_topic
kafka topic handle
rd_kafka_headers_t * rd_kafka_headers
kafka produce event headers structure handle
pthread_rwlock_t rwlock
access lock
N_STR * errstr
kafka error string holder
int64_t poll_interval
poll interval in usecs
int pooling_thread_status
pooling thread status, 0 => off , 1 => on , 2 => wants to stop, will be turned out to 0 by exiting po...
rd_kafka_conf_t * rd_kafka_conf
kafka structure handle
LIST * received_events
list of received N_KAFKA_EVENT
LIST * events_to_send
list of N_KAFKA_EVENT to send
rd_kafka_t * rd_kafka_handle
kafka handle (producer or consumer)
LIST * received_headers
kafka consume event headers structure handle
N_STR * event_string
string containing the topic id + payload
char * groupid
consumer group id
N_STR * event_files_to_delete
string containing the original event source file name if it is to be deleted when event is produced.
int schema_id
kafka schema id in network order
struct N_KAFKA * parent_table
access lock
char * bootstrap_servers
kafka bootstrap servers string
char * from_topic
in case of received event, else NULL
unsigned int status
state of the event: N_KAFKA_EVENT_CREATED ,N_KAFKA_EVENT_QUEUED , N_KAFKA_EVENT_WAITING_ACK ,...
char * topic
kafka topic string
int n_kafka_add_header_ex(N_KAFKA_EVENT *event, char *key, size_t key_length, char *value, size_t value_length)
add a header entry to an event.
int n_kafka_dump_unprocessed(N_KAFKA *kafka, char *directory)
dump unprocessed/unset events
N_KAFKA_EVENT * n_kafka_get_event(N_KAFKA *kafka)
get a received event from the N_KAFKA kafka handle
int n_kafka_new_headers(N_KAFKA_EVENT *event, size_t count)
allocate a headers array for the event
int32_t n_kafka_get_schema_from_char(char *string)
get a schema from the first 4 bytes of a char *string, returning ntohl of the value
int n_kafka_put_schema_in_nstr(N_STR *string, int schema_id)
put a htonl schema id into the first 4 bytes of a N_STR *string
N_KAFKA * n_kafka_load_config(char *config_file, int mode)
load a kafka configuration from a file
int n_kafka_put_schema_in_char(char *string, int schema_id)
put a htonl schema id into the first 4 bytes of a char *string
int n_kafka_poll(N_KAFKA *kafka)
Poll kafka handle in producer or consumer mode.
int n_kafka_event_destroy(N_KAFKA_EVENT **event)
destroy a kafka event and set it's pointer to NULL
void n_kafka_event_destroy_ptr(void *event)
festroy a kafka event
int n_kafka_load_unprocessed(N_KAFKA *kafka, char *directory)
load unprocessed/unset events
int n_kafka_add_header(N_KAFKA_EVENT *event, N_STR *key, N_STR *value)
add a header entry to an event.
int n_kafka_stop_pooling_thread(N_KAFKA *kafka)
stop the pooling thread of a kafka handle
int n_kafka_produce(N_KAFKA *kafka, N_KAFKA_EVENT *event)
put an event in the events_to_send list
N_KAFKA_EVENT * n_kafka_new_event_from_char(char *string, size_t written, int schema_id)
make a new event from a char *string
int32_t n_kafka_get_schema_from_nstr(N_STR *string)
get a schema from the first 4 bytes of a N_STR *string, returning ntohl of the value
int n_kafka_get_status(N_KAFKA *kafka, int *nb_queued, int *nb_waiting, int *nb_error)
return the queues status
int n_kafka_start_pooling_thread(N_KAFKA *kafka)
start the pooling thread of a kafka handle
N_KAFKA_EVENT * n_kafka_new_event(int schema_id)
create a new empty event
N_KAFKA_EVENT * n_kafka_new_event_from_file(char *filename, int schema_id)
make a new event from a N_STR *string
N_KAFKA * n_kafka_new(int64_t poll_timeout, int64_t poll_interval, size_t errstr_len)
allocate a new kafka handle
void n_kafka_delete(N_KAFKA *kafka)
delete a N_KAFKA handle
N_KAFKA_EVENT * n_kafka_new_event_from_string(N_STR *string, int schema_id)
make a new event from a N_STR *string
structure of a KAFKA consumer or producer handle
structure of a KAFKA message
A box including a string and his lenght.