question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quarkus environment variables not working

See original GitHub issue

Some 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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mrnikocommented, Feb 4, 2022

Fixed. Now QUARKUS_REDISSON_SINGLESERVERCONFIG_ADDRESS should work.

0reactions
Adler95commented, Jan 27, 2022

Using QUARKUS_REDISSON_SINGLE__SERVER__CONFIG_ADDRESS produces this error:

Caused by: javax.enterprise.event.ObserverException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "single" (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: 1, column: 34] (through reference chain: org.redisson.config.Config["single"])
	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)
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found