quarkus: KStreams extension does not support configure it in code
Describe the bug
KStreams extension does not support configure in code as if you try to configure KStreams programmatically, you get:
java.lang.RuntimeException: Failed to start quarkus
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:198)
at io.quarkus.runtime.Application.start(Application.java:89)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:90)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:30)
Caused by: io.quarkus.runtime.configuration.ConfigurationException: One or more configuration errors has prevented the application from starting. The errors are:
Configuration key "quarkus.kafka-streams.application-id" is required, but its value is empty/missing: Property quarkus.kafka-streams.application-id not found
Configuration key "quarkus.kafka-streams.topics" is required, but its value is empty/missing: Property quarkus.kafka-streams.topics not found
Expected behavior
To be able to configure kstreams programmatically. Really critical for command line mode.
Actual behavior
An exception is thrown.
To Reproduce Steps to reproduce the behavior:
- Create a plain project with kstreams extension
- Create the quarkus main
- Package and run
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 21 (19 by maintainers)
So the way we should deal with this is via some kinda of annotation based way of consuming/processing command line arguments, including the ability to bind them to config properties. Something like
@ConfigParam(short="t", long="topic", usage="Specifies a Kafka Topic to connect to", repeatable=true, configProperty="quarkus.kafka-streams.topics")This should be part of a generic module that makes it easy to parse command line params and print usage instructions etc. @maxandersen have you looked into this at all, I know there was some talk about picocli?
@maxandersen Exactly that’s my point, suppose I want to implement
ocin Quarkus. I would expect to be able to createoc login --token=XXXand notoc login -Dtoken=XXX