![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Kafka generic produce and consume event header. More...
#include "nilorea/n_log.h"#include "nilorea/n_network.h"#include "cJSON.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <locale.h>#include <libgen.h>#include <errno.h>#include <unistd.h>#include "rdkafka.h"
Include dependency graph for n_kafka.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | N_KAFKA |
| structure of a KAFKA consumer or producer handle More... | |
| struct | N_KAFKA_EVENT |
| structure of a KAFKA message More... | |
Macros | |
| #define | N_KAFKA_EVENT_CREATED 5 |
| state of a freshly created event | |
| #define | N_KAFKA_EVENT_ERROR 2 |
| state of an errored event | |
| #define | N_KAFKA_EVENT_OK 4 |
| state of an OK event | |
| #define | N_KAFKA_EVENT_QUEUED 0 |
| state of a queued event | |
| #define | N_KAFKA_EVENT_WAITING_ACK 1 |
| state of a sent event waiting for acknowledgement | |
Functions | |
| 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_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. | |
| void | n_kafka_delete (N_KAFKA *kafka) |
| delete a N_KAFKA handle | |
| int | n_kafka_dump_unprocessed (N_KAFKA *kafka, char *directory) |
| dump unprocessed/unset events | |
| 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 | |
| N_KAFKA_EVENT * | n_kafka_get_event (N_KAFKA *kafka) |
| get a received event from the N_KAFKA kafka handle | |
| 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 | |
| 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, size_t *nb_queued, size_t *nb_waiting, size_t *nb_error) |
| return the queues status | |
| N_KAFKA * | n_kafka_load_config (char *config_file, int mode) |
| load a kafka configuration from a file | |
| int | n_kafka_load_unprocessed (N_KAFKA *kafka, char *directory) |
| load unprocessed/unset events | |
| N_KAFKA * | n_kafka_new (int32_t poll_timeout, int32_t poll_interval, size_t errstr_len) |
| allocate a new 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_char (char *string, size_t written, int schema_id) |
| make a new event from a char *string | |
| 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_EVENT * | n_kafka_new_event_from_string (N_STR *string, int schema_id) |
| make a new event from a N_STR *string | |
| int | n_kafka_new_headers (N_KAFKA_EVENT *event, size_t count) |
| allocate a headers array for the event | |
| int | n_kafka_poll (N_KAFKA *kafka) |
| Poll kafka handle in producer or consumer mode. | |
| int | n_kafka_produce (N_KAFKA *kafka, N_KAFKA_EVENT *event) |
| put an event in the events_to_send list | |
| 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_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 | |
| int | n_kafka_start_pooling_thread (N_KAFKA *kafka) |
| start the pooling thread of a kafka handle | |
| int | n_kafka_stop_pooling_thread (N_KAFKA *kafka) |
| stop the pooling thread of a kafka handle | |
Kafka generic produce and consume event header.
Definition in file n_kafka.h.