简体   繁体   中英

How to define a beans in application.yml?

I have configuration with two beans:

@Configuration
public class JmsConfiguration {

    @Bean
    PlatformTransactionManager jmsTransactionManager(ConnectionFactory jmsConnectionFactory) {
        return new JmsTransactionManager(jmsConnectionFactory);
    }

    @Bean
    public JmsComponent jms(ConnectionFactory jmsConnectionFactory) {
        return JmsComponent.jmsComponentClientAcknowledge(jmsConnectionFactory);
    }
}

bean description is not spring-boot approach.
I tried define in application.yml and deleted code but it's doesn't work

camel:
    jms:
        session:
            acknowledge:
                 mode: CLIENT_ACKNOWLEDGE

what am I doing wrong?

See the documentation for camel-jms spring boot auto-configuration and the names of the options: https://camel.apache.org/components/latest/jms-component.html#_spring_boot_auto_configuration - there you can see its named camel.component.jms.acknowledgement-mode-name

Also make sure you are using camel-jms-starter as dependency in the pom.xml to use spring boot starters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM