CCCLL opened a new pull request, #23812:
URL: https://github.com/apache/kafka/pull/23812
With `parse.headers=true`, `kafka-console-producer.sh` splits the
headers of each line on `headers.separator`. KIP-798 and the Javadoc
of `LineMessageReader` describe it as a string, and
`headers.delimiter` and `headers.key.separator` are matched
literally, but `headers.separator` is compiled as a regular
expression. A separator containing a regex metacharacter therefore
does not work:
- `|` splits between every character and fails with "No header key
separator found in pair 'h'"
- `.` silently produces records without any header
- `+` or `\` fail with a `PatternSyntaxException`
Compile the separator with `Pattern.LITERAL`. Separators without
metacharacters, such as the default `,`, behave as before.
The new test produces a record with two headers separated by each of
these characters. It fails without the fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]