java - 处理 Lagom 服务响应的压缩

标签 java rest compression lagom

根据这个Lagom doc对于序列化:

Compression, as described here, is only used for persistent events, persistent snapshots and remote messages with the service cluster. It is not used for messages that are serialized in the external API of the service.

我想允许处理请求 header ,例如

Accept-Encoding: gzip, deflate, sdch, br

那么,处理 Lagom 服务对外部应用程序生成的响应压缩的方法是什么,例如网络应用程序?

最佳答案

您想在服务调用中实际处理这个问题,还是想在更高级别上一般处理它?如果你想在更高级别上处理它,那么你需要做的就是启用 Play 的 gzip 过滤器:

https://www.playframework.com/documentation/2.6.x/GzipEncoding

目前仅支持 gzip,但可以对其进行修改以支持其他压缩编码。

关于java - 处理 Lagom 服务响应的压缩,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49831358/

相关文章:

java - Maven:创建 2 个 war 文件,每个文件都有不同的 web.xml?

java - 在 for 循环的最后一次迭代上打印

c# - Azure 存储 REST 组事务 - 请求输入之一超出范围

java - Snappy:如何快速压缩字节缓冲区类型?

algorithm - 使用预计算字典的小块无损压缩

java - 可以依赖单例实例作为共享资源吗?

java - Gson合并JsonObject抛出java.lang.UnsupportedOperationException

java - REST 上的身份验证 token

web-services - 自定义链接关系的 RESTful Web 服务使用 - 'rel'

Hadoop 先生 : better to have compressed input files or raw files?