【问题标题】:Factory method 'broker' threw exception; nested exception is java.io.IOException: Transport scheme NOT recognized: [ws]工厂方法“经纪人”抛出异常;嵌套异常是 java.io.IOException:传输方案无法识别:[ws]
【发布时间】:2018-09-06 01:05:27
【问题描述】:

我正在尝试使用 activemq 服务器配置 websocket,但出现上述错误。我已经用 0.0.0.0 替换了 localhost 但它不起作用。下面是我的代码,请看一下

@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;
    }

【问题讨论】:

    标签: spring-boot websocket activemq


    【解决方案1】:

    这可能会发生,因为基于 HTTP 和 WS 的传输所需的依赖项未包含在代理的类路径中。您应该确保使用您的依赖项中列出的“activemq-http”模块创建代理,例如 maven pom 文件或 IDE 设置。

    【讨论】:

      猜你喜欢
      • 2018-06-15
      • 1970-01-01
      • 2020-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-07
      • 2019-06-23
      相关资源
      最近更新 更多