[KAFKA-398] Source support UUID formatting to hex in simplified JSON formatter Created: 26/Jan/24  Updated: 05/Feb/24

Status: Needs Triage
Project: Kafka Connector
Component/s: Source
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Rick Hanton Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to KAFKA-275 Sink support field data transformations Backlog
Assigned Teams:
Java Drivers

 Description   

We're having substantial struggles utilizing the source connector "out-of-the-box" because it is not able to convert binary (subtype=4) UUID values to hexidecimal string form like it does for OIDs when using the SimplifiedJson JsonWriterSettingsProvider.

 

This could be easily remedied with a conversion for Standard UUIDs included in the provider like

.binaryConverter(
    (value, writer) -> {
        if (BsonBinarySubType.UUID_STANDARD.getValue() == value.getType())
            writer.writeString(value.asUuid().toString());
        else
         writer.writeString(Base64.getEncoder().encodeToString(value.getData()));
}) 

 

 



 Comments   
Comment by PM Bot [ 26/Jan/24 ]

Hi rick.hanton@kubra.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 09:06:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.