[ 
https://issues.apache.org/jira/browse/KAFKA-20076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paolo Patierno updated KAFKA-20076:
-----------------------------------
    Description: 
On trunk and current Kafka 4.2.0 RC0, when running Kafka Connect and submitting 
an HTTP GET request to the /connector-plugins endpoint, the JSON serialized 
"type" filed in the body response is now uppercase instead of being lowercase 
as in the past.
Following a comparison between Apache Kafka 4.1 ...


{code:java}
[{"class":"org.apache.kafka.connect.mirror.MirrorCheckpointConnector","type":"source","version":"4.1.1"},{"class":"org.apache.kafka.connect.mirror.MirrorHeartbeatConnector","type":"source","version":"4.1.1"},{"class":"org.apache.kafka.connect.mirror.MirrorSourceConnector","type":"source","version":"4.1.1"}]
{code}


... and the current Apache Kafka 4.2 RC0


{code:java}
[{"class":"org.apache.kafka.connect.mirror.MirrorCheckpointConnector","type":"SOURCE","version":"4.2.0"},{"class":"org.apache.kafka.connect.mirror.MirrorHeartbeatConnector","type":"SOURCE","version":"4.2.0"},{"class":"org.apache.kafka.connect.mirror.MirrorSourceConnector","type":"SOURCE","version":"4.2.0"}]
{code}


As you can see it's "source" vs "SOURCE". I had same result with "sink" vs 
"SINK".

I think this is due to the last change from converting the PluginInfo from 
being a class to a record which had an impact together with the JSON 
serialization.
When it was a class, a dedicated type.toString() was used which explicitly does 
a lower case transformation.
As a record, the "type" field is directly serialized by JSON by using the enum 
values from PluginType which are all uppercase of course.
It means that this issue affects all the other values as well the way they are 
serialized (not just SINK, SOURCE but also CONVERTER, TRANSFORMATION, and so 
on).

  was:
On trunk and current Kafka 4.2.0 RC0, when running Kafka Connect and submitting 
an HTTP GET request to the /connector-plugins endpoint, the JSON serialized 
"type" filed in the body response is now uppercase instead of being lowercase 
as in the past.
Following a comparison between Apache Kafka 4.1 ...

[{"class":"org.apache.kafka.connect.mirror.MirrorCheckpointConnector","type":"source","version":"4.1.1"},{"class":"org.apache.kafka.connect.mirror.MirrorHeartbeatConnector","type":"source","version":"4.1.1"},{"class":"org.apache.kafka.connect.mirror.MirrorSourceConnector","type":"source","version":"4.1.1"}]

... and the current Apache Kafka 4.2 RC0

[{"class":"org.apache.kafka.connect.mirror.MirrorCheckpointConnector","type":"SOURCE","version":"4.2.0"},{"class":"org.apache.kafka.connect.mirror.MirrorHeartbeatConnector","type":"SOURCE","version":"4.2.0"},{"class":"org.apache.kafka.connect.mirror.MirrorSourceConnector","type":"SOURCE","version":"4.2.0"}]

As you can see it's "source" vs "SOURCE". I had same result with "sink" vs 
"SINK".

I think this is due to the last change from converting the PluginInfo from 
being a class to a record which had an impact together with the JSON 
serialization.
When it was a class, a dedicated type.toString() was used which explicitly does 
a lower case transformation.
As a record, the "type" field is directly serialized by JSON by using the enum 
values from PluginType which are all uppercase of course.
It means that this issue affects all the other values as well the way they are 
serialized (not just SINK, SOURCE but also CONVERTER, TRANSFORMATION, and so 
on).


> Wrong (uppercase) PluginType JSON serialization
> -----------------------------------------------
>
>                 Key: KAFKA-20076
>                 URL: https://issues.apache.org/jira/browse/KAFKA-20076
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Paolo Patierno
>            Assignee: Paolo Patierno
>            Priority: Major
>
> On trunk and current Kafka 4.2.0 RC0, when running Kafka Connect and 
> submitting an HTTP GET request to the /connector-plugins endpoint, the JSON 
> serialized "type" filed in the body response is now uppercase instead of 
> being lowercase as in the past.
> Following a comparison between Apache Kafka 4.1 ...
> {code:java}
> [{"class":"org.apache.kafka.connect.mirror.MirrorCheckpointConnector","type":"source","version":"4.1.1"},{"class":"org.apache.kafka.connect.mirror.MirrorHeartbeatConnector","type":"source","version":"4.1.1"},{"class":"org.apache.kafka.connect.mirror.MirrorSourceConnector","type":"source","version":"4.1.1"}]
> {code}
> ... and the current Apache Kafka 4.2 RC0
> {code:java}
> [{"class":"org.apache.kafka.connect.mirror.MirrorCheckpointConnector","type":"SOURCE","version":"4.2.0"},{"class":"org.apache.kafka.connect.mirror.MirrorHeartbeatConnector","type":"SOURCE","version":"4.2.0"},{"class":"org.apache.kafka.connect.mirror.MirrorSourceConnector","type":"SOURCE","version":"4.2.0"}]
> {code}
> As you can see it's "source" vs "SOURCE". I had same result with "sink" vs 
> "SINK".
> I think this is due to the last change from converting the PluginInfo from 
> being a class to a record which had an impact together with the JSON 
> serialization.
> When it was a class, a dedicated type.toString() was used which explicitly 
> does a lower case transformation.
> As a record, the "type" field is directly serialized by JSON by using the 
> enum values from PluginType which are all uppercase of course.
> It means that this issue affects all the other values as well the way they 
> are serialized (not just SINK, SOURCE but also CONVERTER, TRANSFORMATION, and 
> so on).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to