是否有一些最佳实践可以将一些元数据绑定到反应堆netty中的连接通道?

Is there some best practice that could bind some metadata to connection channel in reactor netty?

提问人:Peng 提问时间:11/14/2023 更新时间:11/14/2023 访问量:15

问:

场景

我想通过 Reactor Netty 构建一个桌面共享应用程序,不同的客户端应该发送一个会议室密钥,当任何人共享其桌面框架数据时,服务器可以添加此元数据房间密钥以找到该房间中的所有客户端并将数据路由到所有客户端。

我在下面构建了一个示例演示

@Slf4j
@ChannelHandler.Sharable
public class RtspRouteHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        log.info("channel read success   {} ",msg.toString());

//        1. find out the meta room key via ctx ??
//        2. check the meta room ket is existed?
//        3. route the data to for specified which is in the same room 
//        call the super for next handler read data is necessart ?  
//        i mean  that is there some encoder or decoder for rtsp data like RtspEncode?
        super.channelRead(ctx, msg);
    }
}

问题

  1. 对于数据解码器和编码器,是否有必要添加 netty 提供给服务器端和客户端的本机处理程序?RtpsEncoderRtspDecoder

2.Is 有什么方法可以将房间钥匙绑定到通道?不将其添加到每个请求的标头中

如果有一些通过 reactor-netty 演示构建 RTSP 服务器,请发布它;

项目-反应堆- NETTY

评论


答: 暂无答案