spring boot – Is there a complete example for Springboot ActiveMQ external broker with SSL Connection configuration?

spring boot – Is there a complete example for Springboot ActiveMQ external broker with SSL Connection configuration?

It appears that auto-configuration via properties is not currently supported. See: https://github.com/spring-projects/spring-boot/issues/17365 and https://github.com/spring-projects/spring-boot/issues/17589.

In the meantime, it is possible to override the default connection with your own ActiveMQSslConnectionFactory bean, providing the SSL configuration properties you need:

@Configuration
public class ActiveMQConfiguration {

    @Bean
    public ActiveMQSslConnectionFactory activeMQSslConnectionFactory(
            @Value(${spring.activemq.broker-url}) String brokerUrl,
            @Value(${spring.activemq.ssl.trustStorePath}) String trustStorePath,
            @Value(${spring.activemq.ssl.trustStorePass}) String trustStorePass,
            @Value(${spring.activemq.ssl.keyStorePath}) String keyStorePath,
            @Value(${spring.activemq.ssl.keyStorePass}) String keyStorePass) throws Exception {
        ActiveMQSslConnectionFactory factory = new ActiveMQSslConnectionFactory(brokerUrl);
        factory.setTrustStore(trustStorePath);
        factory.setTrustStorePassword(trustStorePass);
        factory.setKeyStore(keyStorePath);
        factory.setKeyStorePassword(keyStorePass);
        return factory;
    }
}

The spring.activemq.ssl.* properties arent based on any existing or documented properties, so you dont need to use those specifically.

spring boot – Is there a complete example for Springboot ActiveMQ external broker with SSL Connection configuration?

Leave a Reply

Your email address will not be published. Required fields are marked *