Overriding Kafka topic name using ENV variables fails with : SRMSG00071: Invalid channel configuration - the connector
attribute must be set for channel
#41296
Labels
Milestone
Describe the bug
When using
Messaging - Kafka Connector
and channel names with hyphens it is not possible to overridetopic
name attribute using ENV variables any more (it works in 3.10.2).When defining a channel
@Incoming("words-in")
and specifying topic name inapplication.properties
asmp.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 :
The error indicates that only the first part of the channel name in ENV variable is used :
Instead of setting topic attribute for the "channel" named
words-in
seems like it tries to do it on a non existing Kafka channel calledwords
.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 :
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 withquarkus 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 :Output of
uname -a
orver
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
orgradlew --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.
The text was updated successfully, but these errors were encountered: