Sandro Rey
Sandro Rey

Reputation: 2989

SpringBoot property value inside annotation

I have this annotation

@Listener(topics = "test")

that I want to relace with

@Listener(topics = "@Value(\"${topics}\")")

but I have this error

Could not resolve placeholder 'topics' in value "@Value("${topics}")"

Upvotes: 0

Views: 121

Answers (1)

Marco Behler
Marco Behler

Reputation: 3724

Try:

@Listener(topics = "${topics}")

and make sure the property actually exists.

(Not a 100% sure that it works, but somewhat confident ;) )

Upvotes: 2

Related Questions