-
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
Infinispan Client is ignoring configuration environment variables #5708
Comments
@dmlloyd is it related to all the config fixes that just went in? |
Yes, this is something that was fixed with #5387. |
Thanks @dmlloyd |
Correct, 1.1.0. |
Is this still an issue? |
@geoand lol this is old, I think it was fixed. |
Thanks! |
Are you sure you're using the correct config key? What is the equivalent key in /cc @karesti |
Hey, In the applications.properties we add: |
Hi @karesti Source: https://quarkus.io/guides/infinispan-client-reference So, I believe the docs are out of date. We run all our services built to native images (on Kubernetes). So we prefer, as most as possible, to use ENV vars and keep the BTW, as a work around I am using as following way for a while.
|
@israel-ramos Sorry for what might be confusing docs, however the docs are correct. The named connections are dependant of your configuration. In this case you named it "tagfull". If you have a single connection, you can avoid naming it for simplicity. https://quarkus.io/guides/infinispan-client-reference#default-and-named-connections The documentation then lists all the properties. The "named-infinispan-clients" should be replaced by the name you used. If you check any other database that supports naming connections, you will see that all the docs follow that. |
I have double checked, and none of the following works:
PS.: For the last one, not named, I have also removed the annotation |
@israel-ramos when you state "not working" you mean setting the env variables and removing them all from the application.properties, is that alright ? plus, what do you mean by "not working" ? Is there a crash ? An stacktrace on start ? might be helpful to understand the environment where you are testing those, and how (using the operator?) thanks! :) |
@karesti
and
Full stacktrace:
|
Just a update. Do you believe the "dev services" stuff could be impacting the way the configs are being loaded? PS.: Running here with |
@israel-ramos so, you are running infinispan in a local k8s cluster, and your application is dev mode, is that alright ? |
@karesti yes, it is. That's the way we setup our local dev env, using a local k8s. For a few special kind of tests/debug tasks, during development, we depend on other apps running on that cluster to comunicate with the same infinispan within the cluster. The app under development is running on IDE, outside the cluster. That's why it is running using quarkusDev and connecting to infinispan inside the k8s. Also there are other resources, not only other apps, in the same cluster which we depend on like service mesh, gateway classes, http routes, database, etc... That's the reason. But anyway, many thanks. We will keep using the workaround at the |
@israel-ramos I think in development mode things behave differently. Maybe there is something specific in the Infinispan Extension we are missing for this way of working, but the extension does not do anything in particular and uses quarkus core and config. I'll investigate if this is related to a dev env issue (where the bridge is needed for any extension running this way) or an issue related to the extension. @geoand maybe you can help clarify if this behaviour is normal in any other extension using a database, for example. |
Which behavior are we talking about? |
The env variables and dev mode |
@geoand This one: Using:
In this way, the
But in the following way, DOES NOT WORK. The remote cache instance IS NOT being injected.
PS.: Just to clear. The Infinispan server running at |
I just tried:
and it worked as expected (with the cavear that the logging is misleading which is why I opened #40936). |
Describe the bug
Unless specified in
application.properties
file, configurations for Infinispan Client are being ignored when they are only available via environment variables.For example, if I have an empty
application.properties
file and setQUARKUS_INFINISPAN_CLIENT_SERVER_LIST
environment variable, the client fails to read it and do not connect:(tries to connect to localhost, the default value)
If I set the property
quarkus.infinispan-client.server-list
in the properties file to an empty value, then the environment variable is read and the client successfully connects to the server.Expected behavior
That the Infinispan client extension reads the environment variable without having to explicit set it into an
application.properties
file.Actual behavior
The desired property is not being read from environment variable if it's not presented in the properties file.
To Reproduce
Steps to reproduce the behavior:
export QUARKUS_INFINISPAN_CLIENT_SERVER_LIST=http://im-not-here:11222
mvn clean package -Ppersistence -DskipTests
java -jar target/onboarding-8.0.0-SNAPSHOT-runner.jar
Configuration
Blank properties
Environment (please complete the following information):
Output of
uname -a
orver
: Linux skywalker 5.3.11-200.fc30.x86_64 Switch to the Maven distributed copy of the SubstrateVM annotations #1 SMP Tue Nov 12 19:25:25 UTC 2019 x86_64 x86_64 x86_64 GNU/LinuxOutput of
java -version
:openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-20191008104205.buildslave.jdk8u-src-tar--b07)
OpenJDK 64-Bit GraalVM CE 19.2.1 (build 25.232-b07-jvmci-19.2-b03, mixed mode)
Quarkus version or git rev: 0.27.0
Additional context
Would be nice to have such feature working, so we could configure Quarkus application in containers much easier.
Might be related: #1887
The text was updated successfully, but these errors were encountered: