添加以下bean:
@Beanpublic ActiveMQConnectionFactory activeMQConnectionFactory() { ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("your broker URL"); factory.setTrustedPackages(Arrays.asList("com.my.package")); return factory;}下一个版本已添加了通过配置属性执行此操作的功能:https : //github.com/spring-projects/spring-
boot/issues/5631



