0

I want to load a bean based on two String property value matching conditions.

Egg:

application.properties

foo.test.alpha=sodium
foo.test.beta=chlorine

Bean Config:

@Bean
@ConditionalOnProperty(prefix = "foo.test", name = "alpha", havingValue = "sodium")
public DefaultErrorHandler defaultErrorHandler(final DeadLetterPublishingRecoverer deadLetterPublishRecoverer) {

    // do something
}

In the above bean config am able to check only value of foo.test.aplpha=sodium, but how to add foo.test.beta=chlorine matching in the above config ?

Arun Sai Mustyala
  • 1,736
  • 1
  • 11
  • 27
  • See this question: https://stackoverflow.com/questions/36016864/how-to-check-two-condition-while-using-conditionalonproperty-or-conditionalone – Johan Nordlinder Apr 12 '22 at 04:58
  • Does this answer your question? [How to check two condition while using @ConditionalOnProperty or @ConditionalOnExpression](https://stackoverflow.com/questions/36016864/how-to-check-two-condition-while-using-conditionalonproperty-or-conditionalone) – Paweł Adamski Apr 12 '22 at 05:53

0 Answers0