Enable Support To Get Username and Password from Environment Variable In JBeret SE
Recently we have added a feature that allows users to define the database username and password in jberet.properties
file by using environment variable. Here is an example to define the two variables:
db-user = ${DB_USER:default_user_val}
db-pass = ${DB_PASS}
As the example shown above, the value of db-user
will be read from the variable name DB_USER
. If the the DB_USER
environment variable does not exist, the default value default_user_val
will be used. For db-pass
, its value will be read from the environment variable DB_PASS
, if the variable is not set, the value of db-pass
will be null
.
Please note this feature only works in JBeret SE environment, because the processing logic is in the BatchSEEnvironment
class. Because the JDBC and MongoDB repositories uses the db-user
and db-pass
variables to login, so it means this feature supports these two repositories currently.
For more details, you can check this issue:
It also contains related PRs and discussions in the above link.