SpringBoot + ActiveMQ - How to set trusted packages?

后端 未结 6 936
既然无缘
既然无缘 2021-02-19 04:47

I\'m creating two springboot server & client applications communicating using JMS, and everything is working fine with the release 5.12.1 for activemq, but as s

6条回答
  •  天命终不由人
    2021-02-19 05:28

    If any one still looking for an answer, below snippet worked for me

    @Bean
    public ActiveMQConnectionFactory connectionFactory() {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL(BROKER_URL);
        connectionFactory.setPassword(BROKER_USERNAME);
        connectionFactory.setUserName(BROKER_PASSWORD);
        connectionFactory.setTrustAllPackages(true); // all packages are considered as trusted 
        //connectionFactory.setTrustedPackages(Arrays.asList("com.my.package")); // selected packages
        return connectionFactory;
    }
    

提交回复
热议问题