snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Support for Custom Named Injections #85

Closed snowdrop-bot closed 4 years ago

snowdrop-bot commented 4 years ago

Currently quarkus supports named datasources. This allows for multiple properties to be configured per each injected instance. From the documentation:

@Inject
@DataSource("inventory")
AgroalDataSource inventoryDataSource;

I would like to see similar support added for custom classes

@Inject
@Prefix("hello")
Greeting hello

@Inject
@Prefix("goodbye")
Greeting goodbye

Then in application.properties

greeting.hello.message=hello there General Kenobi
greeting.goodbye.message=these are not the droids you're looking for

I'm aware that there is already support for ConfigProperties(prefix="whatever") however there doesn't seem to be a way to set the prefix dynamically.


https://github.com/quarkusio/quarkus/issues/9136


$upstream:9136$