带有Http2的Netty HttpObjectAggregator

编程入门 行业动态 更新时间:2024-10-23 07:17:56
本文介绍了带有Http2的Netty HttpObjectAggregator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Netty 4.1构建Http2服务器(该服务器仅需要支持Http2客户端).对于我最简单的请求处理,我想在执行任何业务逻辑之前先拥有完整的Http2请求(即 FullHttpRequest ).

I'm building an Http2 server with Netty 4.1 (and the server will only need to support Http2 clients). For my most simple request handling, I want to have the full Http2 request (i.e., FullHttpRequest) before performing any business logic.

如何使用Http2做到这一点?Netty的 HttpObjectAggregator 似乎仅用于Http1.

How can I do this with Http2? Netty's HttpObjectAggregator only seems intended for Http1.

推荐答案

为此,您可能需要在管道中使用 InboundHttp2ToHttpAdapter .请检查:

For this you may need to use the InboundHttp2ToHttpAdapter in your pipeline. Please check:

  • github/netty/netty/blob/4.1/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapter.java
  • github/netty/netty/blob/4.1/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapterBuilder.java

更多推荐

带有Http2的Netty HttpObjectAggregator

本文发布于:2023-11-01 20:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550285.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Netty   HttpObjectAggregator

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!