Skip to content
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

can't setup cloudevents.serializer.event_format in quarkus #595

Open
dfiai opened this issue Oct 5, 2023 · 3 comments
Open

can't setup cloudevents.serializer.event_format in quarkus #595

dfiai opened this issue Oct 5, 2023 · 3 comments
Labels
needs-user-input The author of an issue or PR should provide more details

Comments

@dfiai
Copy link

dfiai commented Oct 5, 2023

Hello everyone, I want to express my appreciation for the fantastic work you're doing!

I've noticed that Quarkus reactive Kafka replaces all underscores (_) with periods (`.``). Here's a code snippet from quarkus code to illustrate this:

private static void extractConfigKey(Config config, JsonObject json, String originalKey, String prefixToStrip) {
    // Transform keys that may come from environment variables.
    // As Kafka properties use ".", transform "_" into "."
    String key = originalKey;
    if (key.contains("_") || allCaps(key)) {
        key = originalKey.toLowerCase().replace("_", ".");
    }
    // ...
}

This transformation is causing an issue for me when trying to pass event_format in the application.properties file:

/**
 * The configuration key for the {@link EventFormat} to use when serializing the event in structured mode.
 */
public final static String EVENT_FORMAT_CONFIG = "cloudevents.serializer.event_format";

Is there a way to also support event.format, or do you have any suggestions for a workaround? Your insights would be greatly appreciated!

@pierDipi
Copy link
Member

pierDipi commented Feb 8, 2024

Last I checked Quarkus, the CloudEvents integration wasn't based on the CE SDK, but that might have changed, can you please share more about your Quarkus and CloudEvents Java SDK setup/configuration/scenario?

@pierDipi
Copy link
Member

pierDipi commented Feb 8, 2024

cc @cescoffier

@pierDipi pierDipi added the needs-user-input The author of an issue or PR should provide more details label Feb 8, 2024
@cescoffier
Copy link

Unfortunately, as explained in the comment, this is done to handle env variables. While far from ideal, it's the best approach (and most reliable) we have found.

I will see what can be done, but the best approach would be to have the attributes use a . as the other Kafka properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-user-input The author of an issue or PR should provide more details
Projects
None yet
Development

No branches or pull requests

3 participants