Skip to content

Commit b9f8d02

Browse files
author
Lars T Hansen
committed
Tweaks
1 parent 6d4eff8 commit b9f8d02

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

util/kafka-proxy/kprox.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//
1515
// Sonar posts data via http/https to this proxy. This proxy decodes the traffic and then speaks
1616
// the normal Kafka protocol to the broker, forwarding individual messages to it. It is not
17-
// necessary for the broker to trust this proxy: the proxy will forward the SASL credentials
17+
// necessary for the broker to trust this proxy: the proxy will forward any SASL credentials
1818
// included in the messages with the messages to the broker.
1919
//
2020
// Logging is to the syslog by default (without options only critical errors, with -v also
@@ -61,9 +61,9 @@
6161
// The [debug] section is honored if -D is present on the command line:
6262
//
6363
// [debug]
64-
// dump = filename
65-
// user = username
66-
// password = password
64+
// dump = filename # default "" - data not dumped, but dropped
65+
// user = username # default "" - username ignored
66+
// password = password # default "" - password ignored
6767
//
6868
// If there is a debug.dump, all validated incoming data are appended to that file. If there are
6969
// debug.user and/or debug.password properties then the sasl-user / sasl-password fields must be set
@@ -330,7 +330,11 @@ func runDebugDumper(ch <-chan Msg) {
330330
"Message #%d received: %s %s %s %s %s %d",
331331
msgId, msg.Topic, msg.Key, msg.Client, msg.SaslUser, msg.SaslPassword, msg.DataSize,
332332
)
333-
log.Printf("Dumping message to %s, not sending to Kafka", dumpFile)
333+
if dump != nil {
334+
log.Printf("Dumping message to %s, not sending to Kafka", dumpFile)
335+
} else {
336+
log.Printf("Dropping message, not sending to Kafka")
337+
}
334338
}
335339
if dump != nil {
336340
bs, _ := json.Marshal(msg.Control)

0 commit comments

Comments
 (0)