How to realize like spring @ConditionalOnMissingBean in Quarkus

Viewed 24

for example in spring, i can create Bean use @ConditionalOnMissingBean when it not existence

  @Bean
  @ConditionalOnMissingBean(AuthCache.class)
  public AuthCache authCache() {
    return new DefaultRedisCache();
  }
1 Answers

What you are looking for is Quarkus's @DefaultBean.

See the documentation for more information.

Related