Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
d82c6152
Commit
d82c6152
authored
Sep 10, 2014
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libtrackrdr-kafka: include the host name in client IDs
parent
26d4372a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
worker.c
trackrdrd/src/mq/kafka/worker.c
+6
-2
No files found.
trackrdrd/src/mq/kafka/worker.c
View file @
d82c6152
...
...
@@ -34,6 +34,8 @@
#include <errno.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <limits.h>
#include "mq_kafka.h"
#include "miniobj.h"
...
...
@@ -51,7 +53,8 @@ get_clock_ms(void)
const
char
*
WRK_Init
(
int
wrk_num
)
{
char
clientid
[
sizeof
(
"libtrackrdr-kafka-worker-2147483648"
)];
char
clientid
[
HOST_NAME_MAX
+
1
+
sizeof
(
"-kafka-worker-2147483648"
)];
char
host
[
HOST_NAME_MAX
+
1
];
rd_kafka_conf_t
*
wrk_conf
;
rd_kafka_topic_conf_t
*
wrk_topic_conf
;
rd_kafka_t
*
rk
;
...
...
@@ -62,7 +65,8 @@ const char
wrk_conf
=
rd_kafka_conf_dup
(
conf
);
wrk_topic_conf
=
rd_kafka_topic_conf_dup
(
topic_conf
);
sprintf
(
clientid
,
"libtrackrdr-kafka-worker-%d"
,
wrk_num
);
AZ
(
gethostname
(
host
,
HOST_NAME_MAX
+
1
));
sprintf
(
clientid
,
"%s-kafka-worker-%d"
,
host
,
wrk_num
);
if
(
rd_kafka_conf_set
(
wrk_conf
,
"client.id"
,
clientid
,
errmsg
,
LINE_MAX
)
!=
RD_KAFKA_CONF_OK
)
{
MQ_LOG_Log
(
LOG_ERR
,
"rdkafka config error [client.id = %s]: %s"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment