以下框架都使用了Netty
- Cassandra
- Spark
- Hadoop
- RocketMQ
- ElasticSearch
- gRPC
- Dubbo
- Spring 5.x .的 webflux (完全抛弃了tomcat, 使用netty作为服务器端)
- Zookeeper
优势:
无需构建协议、解决TCP传输问题(如粘包&拆包)、进行包装增强(如FastThreadLocal => ThreadLocal, ByteBuf => ByteBuffer)
适用场景:
自定义RPC框架、WebSocket服务
依赖使用:
<dependency><groupId>io.netty</groupId><artifactId>netty-all</artifactId><version>4.1.73.Final</version></dependency>
