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

Overriding Kafka topic name using ENV variables fails with : SRMSG00071: Invalid channel configuration - the connector attribute must be set for channel #41296

Closed
teedjay opened this issue Jun 18, 2024 · 5 comments · Fixed by #41318
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@teedjay
Copy link

teedjay commented Jun 18, 2024

Describe the bug

When using Messaging - Kafka Connector and channel names with hyphens it is not possible to override topic name attribute using ENV variables any more (it works in 3.10.2).

When defining a channel @Incoming("words-in") and specifying topic name in application.properties as mp.messaging.incoming.words-in.topic=words it works as expected.

But trying to override topic name with ENV variable and screaming snake case as shown below fails :

MP_MESSAGING_INCOMING_WORDS_IN_TOPIC=words

The error indicates that only the first part of the channel name in ENV variable is used :

SRMSG00071: Invalid channel configuration -  the `connector` attribute must be set for channel `words`

Instead of setting topic attribute for the "channel" named words-in seems like it tries to do it on a non existing Kafka channel called words.

Expected behavior

Overriding topic attribute for channels should be possible using ENV variables (even if for channel names containing hyphens). It works in 3.10.2.

Actual behavior

Quarkus 3.11.2 does not start and fails with :

java.lang.IllegalArgumentException: SRMSG00071: Invalid channel configuration -  the `connector` attribute must be set for channel `words

How to Reproduce?

(1)
From https://code.quarkus.io/ create a sample app with Messaging - Kafka Connector starter code and Quarkus 3.11 and Java 21. Start it with quarkus dev and it works as expected.

(2)
Override TOPIC name by using ENV variable :
export MP_MESSAGING_INCOMING_WORDS_IN_TOPIC=words

(3)
When starting quarkus dev now it fails to start with error like this :

SRMSG00071: Invalid channel configuration -  the `connector` attribute must be set for channel `words`

Output of uname -a or ver

Darwin Kernel Version 23.5.

Output of java -version

openjdk version "21.0.2" 2024-01-16 LTS

Quarkus version or git rev

3.11.2

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

I reproduced this on my MacBookPro 2019 with Intel processor. But we have the exact same issue in production (using containers on Kubernetes in Azure), so it is not a local issue.

I have also tried various "workarounds" mentioned in earlier Quarkus issues that contain the exception "SRMSG00071", none of them solved it for us.

Copy link

quarkus-bot bot commented Jun 18, 2024

/cc @alesj (kafka), @cescoffier (kafka), @geoand (kubernetes), @iocanel (kubernetes), @ozangunalp (kafka), @radcortez (config)

@cescoffier
Copy link
Member

@radcortez Are you aware of any change around environment variables in Quarkus? We have tests for this in SmallRye and we did not catch it (without Quarkus but using the latest SR Config)

@radcortez
Copy link
Member

Nothing that I can think of. I'll have a look.

@radcortez
Copy link
Member

This will be fixed by smallrye/smallrye-config#1180

@radcortez
Copy link
Member

Unfortunately, I don't think a workaround exists, so we need a new release. Sorry for the inconvenience.

@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jun 24, 2024
@gsmet gsmet modified the milestones: 3.13 - main, 3.12.1 Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants