我正在尝试使用activemq服务器配置websocket但我得到了上述错误。我已经替换了localhost机智0.0.0.0但是它没有用.Below是我的代码请看看
@Bean
public BrokerService broker() throws Exception {
final BrokerService broker = new BrokerService();
// configure the broker
broker.addConnector( "ws://localhost:61614" );
broker.setPersistent(false);
final ActiveMQTopic topic = new ActiveMQTopic( topicstring );
broker.setDestinations( new ActiveMQDestination[] { topic } );
final ManagementContext managementContext = new ManagementContext();
managementContext.setCreateConnector(true);
broker.setManagementContext(managementContext);
return broker;
}
这可能会发生,因为基于HTTP和WS的传输所需的依赖关系不包含在代理的类路径中。您应该确保使用依赖项中列出的“activemq-http”模块创建代理,例如maven pom文件或IDE设置。