Skip to content

Feat: Add ErrorMessage class for Schema Registry client.#38

Merged
acocuzzo merged 2 commits intogoogleapis:mainfrom
an2x:sr-error-format
May 27, 2025
Merged

Feat: Add ErrorMessage class for Schema Registry client.#38
acocuzzo merged 2 commits intogoogleapis:mainfrom
an2x:sr-error-format

Conversation

@an2x
Copy link
Contributor

@an2x an2x commented May 27, 2025

Adding a modified version of io.confluent.kafka.schemaregistry.client.rest.entities.ErrorMessage from the Confluent Schema Registry Client, which has the same structure in Java and is still fully compatible with the client code, but supports parsing the source JSON error message in more formats via Jackson annotations.

Pre-pending this auth library to the classpath of an application using a Schema Registry client will override the class implementation and will allow parsing Managed Kafka style error messages.

If using Maven, this can be achieved by adding this dependency first in the pom.xml file:

<dependencies>
    <dependency>
      <groupId>com.google.cloud.hosted.kafka</groupId>
      <artifactId>managed-kafka-auth-login-handler</artifactId>
      <version>1.0.6</version>
    </dependency>
    ... other dependencies ...
</dependencies>

If running an existing application from the command line, the jar file needs to be pre-pended to the classpath:

java -cp managed-kafka-auth-login-handler-1.0.6.jar:<other class path entries> <main class>

@an2x an2x requested a review from a team May 27, 2025 17:03
@acocuzzo acocuzzo self-assigned this May 27, 2025
@acocuzzo acocuzzo changed the title Add ErrorMessage class for Schema Registry client. Feature: Add ErrorMessage class for Schema Registry client. May 27, 2025
@acocuzzo acocuzzo changed the title Feature: Add ErrorMessage class for Schema Registry client. Feat: Add ErrorMessage class for Schema Registry client. May 27, 2025
@acocuzzo acocuzzo merged commit 9f549f6 into googleapis:main May 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants