|
14 | 14 | // |
15 | 15 | // Sonar posts data via http/https to this proxy. This proxy decodes the traffic and then speaks |
16 | 16 | // 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 |
18 | 18 | // included in the messages with the messages to the broker. |
19 | 19 | // |
20 | 20 | // Logging is to the syslog by default (without options only critical errors, with -v also |
|
61 | 61 | // The [debug] section is honored if -D is present on the command line: |
62 | 62 | // |
63 | 63 | // [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 |
67 | 67 | // |
68 | 68 | // If there is a debug.dump, all validated incoming data are appended to that file. If there are |
69 | 69 | // 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) { |
330 | 330 | "Message #%d received: %s %s %s %s %s %d", |
331 | 331 | msgId, msg.Topic, msg.Key, msg.Client, msg.SaslUser, msg.SaslPassword, msg.DataSize, |
332 | 332 | ) |
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 | + } |
334 | 338 | } |
335 | 339 | if dump != nil { |
336 | 340 | bs, _ := json.Marshal(msg.Control) |
|
0 commit comments