java - Inject Spel parameter on annotation parameter (like what is done with @Value on a field) -
i'm using annotation provided spring-starter-elastic-search
to create document , inject parameter indexname
dynamically:
@entity @document(indexname = "myindex") public class stockquotation
in bean have done using @value
on field:
@value("${elasticsearch.index.name}") public string indexname;
however, have tried inject in same way in annotation , translation not done:
@entity @document(indexname = "${elasticsearch.index.name}") public class stockquotation
as exception:
caused by: org.elasticsearch.indices.indexmissingexception: [${elasticsearch.index.name}] missing
what appropriate approach this?
thanks
Comments
Post a Comment