Quarkus environment variables not working
See original GitHub issueSome environment variables are not working.
quarkus:
redisson:
single-server-config:
address:
- "redis://127.0.0.1:16379"
In case we want to override this value with the environment variable: QUARKUS_REDISSON_SINGLESERVERCONFIG_ADDRESS, the configuration fails to load. It seems that: https://github.com/redisson/redisson/issues/3943 didn’t completely solve issues with environment variables.
Expected behavior Configuration should successfully load when using ENV variables.
Actual behavior
Caused by: javax.enterprise.event.ObserverException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "singleserverconfig" (class org.redisson.config.Config), not marked as ignorable (23 known properties: "eventLoopGroup", "maxCleanUpDelay", "nettyHook", "keepPubSubOrder", "nettyThreads", "threads", "transportMode", "singleServerConfig", "sentinelServersConfig", "reliableTopicWatchdogTimeout", "useScriptCache", "minCleanUpDelay", "connectionListener", "executor", "codec", "replicatedServersConfig", "clusterServersConfig", "useThreadClassLoader", "masterSlaveServersConfig", "addressResolverGroupFactory", "lockWatchdogTimeout", "cleanUpKeysAmount", "referenceEnabled"])
at [Source: (StringReader); line: 4, column: 3] (through reference chain: org.redisson.config.Config["singleserverconfig"])
at io.quarkus.arc.impl.EventImpl$ObserverExceptionHandler.lambda$static$0(EventImpl.java:542)
at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:322)
at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:302)
at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73)
at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
... 13 more
Steps to reproduce or test case
- Setup Quarkus project
- Add redisson-quarkus-20 dependency
- Set environment variable: QUARKUS_REDISSON_SINGLESERVERCONFIG_ADDRESS
Redis version 6.2.6
Redisson version
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-quarkus-20</artifactId>
<version>3.16.8</version>
</dependency>
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Configuration Reference Guide - Quarkus
Environment variables in the .env file are not available via the System.getenv(String) API. 1.4. Quarkus Application configuration file.
Read more >Quarkus how to set environment variables in application ...
In application.properties you can use: somename=${HOST:localhost}. which will correctly expand the HOST environment variable and use ...
Read more >Environment variable mapping is not working propertly using ...
Environment variable mapping is not working propertly using @ConfigMapping or ... It's working using @deprecated io.quarkus.arc.config.
Read more >4. Configuration - Quarkus Cookbook [Book] - O'Reilly
Solution. You can overwrite any property at runtime by setting it as a system property or environment variable. Quarkus lets you overwrite any...
Read more >Chapter 6. Setting configuration properties
By default, Quarkus reads properties from the application.properties file located in ... Environment variable names follow the conversion rules of Eclipse ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Fixed. Now QUARKUS_REDISSON_SINGLESERVERCONFIG_ADDRESS should work.
Using QUARKUS_REDISSON_SINGLE__SERVER__CONFIG_ADDRESS produces this error: