Skip to content
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

how to read variable values from application.conf that are in .env file #168

Open
mohika-knoldus opened this issue Apr 14, 2024 · 0 comments

Comments

@mohika-knoldus
Copy link

mohika-knoldus commented Apr 14, 2024

@japgolly

my application.conf file contains variable to be read from .env and when i run this i get an error.Though other values have been read only variables are the problem.
// app.conf
myapp.dbconfig.threads-pool-count = 2
myapp.dbconfig.threads-pool-count = ${?DB_THREAD_POOL_COUNT}
// queueSize The size of the job queue, 0 for direct hand-off or -1 for unlimited size.
myapp.dbconfig.queue-size = 50
myapp.dbconfig.queue-size = ${?DB_QUEUE_SIZE}
myapp.dbconfig.search-limit = 10
myapp.dbconfig.search-limit = ${?SEARCH_LIMIT}

error:-

Exception in thread "main" java.lang.RuntimeException: 3 errors:
[error] - Error reading key [myapp.dbconfig.queue-size] from source [cp:/application.conf] with value [${DB_QUEUE_SIZE}]: Int expected.
[error] - Error reading key [myapp.dbconfig.search-limit] from source [cp:/application.conf] with value [${SEARCH_LIMIT}]: Int expected.
[error] - Error reading key [myapp.dbconfig.threads-pool-count] from source [cp:/application.conf] with value [${DB_THREAD_POOL_COUNT}]: Int expected.
[error] 5 sources (highest to lowest priority):
[error] - Env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant