【问题标题】:How to manually test lagom websocket API?如何手动测试 lagom websocket API?
【发布时间】:2018-02-18 02:18:15
【问题描述】:

我下载了 Lagom 示例项目,其中包括简单的 websocket 端点 named("example-stream") .withCalls( namedCall("stream", stream) ).withAutoAcl(true) 当我启动应用程序并尝试打开 websocket 连接 (ws://localhost:9000/stream) 时,服务器日志打印:

[warn] akka.actor.ActorSystemImpl [sourceThread=application-akka.actor.default-dispatcher-53, akkaSource=akka.actor.ActorSystemImpl(application), sourceActorSystem=application, akkaTimestamp=18:02:21.293UTC] - HTTP header 'Sec-WebSocket-Extens ions: permessage-deflate' is not allowed in requests 20:02:21.301 [warn] runstats-stream [] - Could not negotiate a deserializer for type MessageProtocolImpl(Some(none/none),None,None), the default media type supported is MessageProtocolImpl(Some(text/plain),Some(utf-8),None)

为此,我使用名为 Browser Websocket 客户端的 Firefox 插件。据我所知,Websocket 握手不需要或设置显然 lagom websocket 端点所期望的 Content-Type。

是我做错了什么还是生成的项目在某种程度上无效?

【问题讨论】:

  • 你在哪里找到的例子?

标签: websocket lagom


【解决方案1】:

你没有做错任何事。 Lagom 1.4.0 提供了两种不同的服务器端 websocket 处理实现(netty vs AkkaHTTP)。 Lagom 中的默认实现是基于 AkkaHTTP 的,我们最近发现了一个 issue。该解决方案已经制定,但在我们发布 Lagom 1.4.1 之前它不会可用。

与此同时,您可以在migration guide details on how to select a different server engine 之后选择加入基于网络的实现(过去是默认的)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-12
    • 1970-01-01
    • 2020-08-30
    • 2017-08-25
    • 1970-01-01
    • 2020-09-22
    相关资源
    最近更新 更多