diff --git a/docker/Dockerfile.m4 b/docker/Dockerfile.m4 index 808b77c..2a5c71c 100644 --- a/docker/Dockerfile.m4 +++ b/docker/Dockerfile.m4 @@ -1,4 +1,4 @@ -FROM alpine:3.6 +FROM alpine:3.7 # envsubst (gettext is very big! install only binary & dependency) RUN apk add --no-cache libintl gettext && \ @@ -6,10 +6,7 @@ RUN apk add --no-cache libintl gettext && \ apk del gettext # Common C runtime libraries -RUN apk add --no-cache librdkafka jansson zlib - -# n2k libraries -RUN apk add --no-cache yajl libmicrohttpd libev +RUN apk add --no-cache librdkafka zlib # ca-certificates: for wget bootstrapping # ncurses - expat: deps for xml-coreutils diff --git a/src/main.c b/src/main.c index 2f30f33..60195dc 100644 --- a/src/main.c +++ b/src/main.c @@ -553,8 +553,7 @@ static int worker_process_sensor_send_array(struct _worker_info *worker_info, rdlog(LOG_ERR, "[Kafka] Cannot produce kafka message: " "%s", - rd_kafka_err2str(rd_kafka_errno2err( - errno))); + rd_kafka_err2str(rd_kafka_last_error())); } } /* if kafka */ @@ -762,6 +761,9 @@ int main(int argc, char *argv[]) { worker_info.rk_conf = rd_kafka_conf_new(); worker_info.rkt_conf = rd_kafka_topic_conf_new(); + // Default to librdkafka pre-0.11 behavior: + rd_kafka_conf_set(worker_info.rk_conf, "linger.ms", "1000", NULL, 0); + pthread_t *pd_thread = NULL; rd_fifoq_t queue; sensor_queue_init(&queue);