Skip to content

Commit 1b89b47

Browse files
nokute78edsiper
authored andcommitted
out_kafka: fix broken config map(#5097)
Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent eef2d5c commit 1b89b47

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

plugins/out_kafka/kafka.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,8 @@ static struct flb_config_map config_map[] = {
541541
},
542542
{
543543
FLB_CONFIG_MAP_INT, "queue_full_retries", FLB_KAFKA_QUEUE_FULL_RETRIES,
544-
0, FLB_TRUE, offsetof(struct flb_out_kafka, timestamp_format_str),
545-
"Set the format the timestamp is in."
544+
0, FLB_TRUE, offsetof(struct flb_out_kafka, queue_full_retries),
545+
"Set the number of local retries to enqueue the data."
546546
},
547547
{
548548
FLB_CONFIG_MAP_STR, "gelf_timestamp_key", (char *)NULL,

plugins/out_kafka/kafka_config.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
struct flb_out_kafka *flb_out_kafka_create(struct flb_output_instance *ins,
3131
struct flb_config *config)
3232
{
33+
int ret;
3334
const char *tmp;
3435
char errstr[512];
3536
struct mk_list *head;
@@ -46,6 +47,13 @@ struct flb_out_kafka *flb_out_kafka_create(struct flb_output_instance *ins,
4647
ctx->ins = ins;
4748
ctx->blocked = FLB_FALSE;
4849

50+
ret = flb_output_config_map_set(ins, (void*) ctx);
51+
if (ret == -1) {
52+
flb_plg_error(ins, "unable to load configuration.");
53+
flb_free(ctx);
54+
return -1;
55+
}
56+
4957
/* rdkafka config context */
5058
ctx->conf = flb_kafka_conf_create(&ctx->kafka, &ins->properties, 0);
5159
if (!ctx->conf) {

0 commit comments

Comments
 (0)