您的配置
broker.addConnector("tcp://localhost:61616?broker.persistent=false");错误,仅当您使用ActiveMQConnectionFactory,http://activemq.apache.org/how-
do-i-embed-a-broker-inside-a-
connection.html#HowdoIembedaBrokerinsideaConnection-创建代理时,才能完成此操作使用ActiveMQConnectionFactory
Using ActiveMQConnectionFactoryAn embedded broker can also be created using an ActiveMQConnectionFactory and using a vm connector as a uri. e.g.ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");尝试
@Bean public BrokerService broker() throws Exception { BrokerService broker = new BrokerService(); broker.addConnector("tcp://localhost:61616"); broker.setPersistent(false); return broker; }


