1

In Quarkus, We have properties file inside project itself called application.properties.

Is there any Quarkus way to define external properties file in my use case like i am developing a mail sender and i want to add recipients in future.

Is it possible to give application.properties outside at local and inject it at runtime?

fatherazrael
  • 5,511
  • 16
  • 71
  • 155

3 Answers3

4

You can add a configuration file in your application working directory under config/application.properties : https://quarkus.io/guides/config#overriding-properties-at-runtime

There is ongoing discussion to have more runtime configuration capabilities here: https://github.com/quarkusio/quarkus/issues/1218

loicmathieu
  • 5,181
  • 26
  • 31
  • @loicnathieu: It appears, it does not support runtime picking configuration from external location, i need to write property file reader etc for same. – fatherazrael Jan 09 '20 at 11:29
2

As loïc says, you can follow the convention and create a config/application.properties. You can also use the property quarkus.config.locations to specify additional config locations. It can be defined at runtime like below

java -Dquarkus.config.locations=app-config/config.properties -jar my-app.jar

Olivier Boissé
  • 15,834
  • 6
  • 38
  • 56
0

You can achieve this by keeping .properties (or .yaml) in Spring Cloud Config Server. It's really easy to set it up. It's is well documented in following link (official documentation): Quarkus - Reading properties from Spring Cloud Config Server

Igor Vuković
  • 742
  • 12
  • 25