-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix-#181: Send the ack token as String #182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @elruwen ! Overall LGTM, but I left a few comments. Can you take a look at them?
@@ -71,12 +66,15 @@ public void ingest(String tag, ByteBuffer dataBuffer) | |||
ByteBuffer headerBuffer = ByteBuffer.wrap(header.toByteArray()); | |||
|
|||
if (config.isAckResponseMode()) { | |||
byte[] uuidBytes = UUID.randomUUID().toString().getBytes(CHARSET); | |||
ByteBuffer optionBuffer = ByteBuffer.wrap(objectMapper.writeValueAsBytes(new RequestOption(dataLength, uuidBytes))); | |||
// The spec says to encode a 128 bit value as base64, but fluent-bit currently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which document does it mean by The spec
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ByteBuffer optionBuffer = ByteBuffer.wrap(objectMapper.writeValueAsBytes(new RequestOption(dataLength, uuidBytes))); | ||
// The spec says to encode a 128 bit value as base64, but fluent-bit currently | ||
// uses a 32 char long hex string, so we do the same for now. | ||
String token = UUID.randomUUID().toString().replace("-", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK token formats in Fluentd and Fluent Bit are different and there is no validation of it. How about simply passing a UUID hex string as is without removing hyphen? If Fluentd and Fluent Bit implement a validation of ACK token in the future, it would be time to change this format in Fluency as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I still think it is better to comply with the spec straight away, but I am also fine with going ahead like this for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Let's follow the spec later after Fluentd and Fluent bit use a consistent format.
Hi!
As discussed in the ticket, here the fix. I fixed small issues I found around the places I changed, too.
Cheers
Ruwen
PS: I struggled a bit with the code style, I hope I didn't miss anything.