-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Environment Variables not replaced in application.properties when running as Docker container #4571
Comments
Did this ever work? I don't know how far the Quarkus support for configuration properties at runtime is supposed to go. @ivangfr you can add the environment variable KAFKA_BOOTSTRAP_SERVERS to your Quarkus container, to specify the bootstrap server globally, and remove mp.messaging.outgoing.news.bootstrap.servers. Maybe that works for you? You can also try if you get it working with MP_MESSAGING_OUTGOING_NEWS_BOOTSTRAP_SERVERS=HOST:PORT. I think the Kafka Guide is not very specific about how properties are handled and which properties are fixed at build time. The Kafka Streams Guide is more explicit about properties. |
Hey @xfh, Using So now, my docker command looks like
What I also did was to set two properties in
So, for "production" the default is I have just asked because other frameworks like Spring Boot and Micronaut work when the property in application.properties has the format as shown below
|
This works for me: |
I think more of the properties with the A non-breaking strategy would be to make all these properties runtime configurable, unless they are known to be static, like |
Yes it should but we'll need to explicitly verify it to be sure. |
All the mp.messagging.* properties are hard-coded during build time. Variables with run-time configuration are unfortunately not supported. This limits configuration for specific environments and has been reported: quarkusio/quarkus#4571 (comment) Currently, it works, as long as quarkus runs in the same docker network as the schema-registry. The http://schema-registry:8081 URL must be resolvable at run-time.
Describe the bug
In my application.properties, I have the following property
When I run the application in development mode
./mvnw compile quarkus:dev
the url to local kafka cluster is written correctly, i.e,localhost:9092
Then, I build the Docker image
Finally, when I run the container
I get the following in the logs
Expected behavior
The correct url to Kafka cluster should be
Actual behavior
Configuration
Environment (please complete the following information):
uname -a
orver
:java -version
:openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-20190711112007.graal.jdk8u-src-tar-gz-b08)
OpenJDK 64-Bit GraalVM CE 19.2.0 (build 25.222-b08-jvmci-19.2-b02, mixed mode)
The text was updated successfully, but these errors were encountered: