79568476

Date: 2025-04-11 09:25:34
Score: 1
Natty:
Report link

Finally, I decided to use Configuration class with ConnectionFactoryCustomizer bean depending on spring.rabbitmq.ssl.enabled property:

@Configuration
class RabbitConfig {
    @Bean
    @ConditionalOnProperty(name = ["spring.rabbitmq.ssl.enabled"], havingValue = "true", matchIfMissing = false)
    fun connectionFactoryCustomizer(): ConnectionFactoryCustomizer {
        return ConnectionFactoryCustomizer { 
            it.saslConfig = DefaultSaslConfig.EXTERNAL
        }
    }
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Semyon Volokh