{"id":19750,"date":"2025-04-19T02:12:59","date_gmt":"2025-04-18T18:12:59","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/19750.html"},"modified":"2025-04-19T02:12:59","modified_gmt":"2025-04-18T18:12:59","slug":"netty%e6%98%af%e4%b8%80%e4%b8%aa%e5%9f%ba%e4%ba%8ejava%e7%9a%84%e5%bc%82%e6%ad%a5%e4%ba%8b%e4%bb%b6%e9%a9%b1%e5%8a%a8%e7%9a%84%e7%bd%91%e7%bb%9c%e5%ba%94%e7%94%a8%e6%a1%86%e6%9e%b6%ef%bc%8c%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/19750.html","title":{"rendered":"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef"},"content":{"rendered":"<p>Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6&#xff0c;\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u3002\u5b83\u80fd\u591f\u4e0e\u591a\u79cd\u6846\u67b6\u7ed3\u5408\u4f7f\u7528&#xff0c;\u4ee5\u5b9e\u73b0\u4e0d\u540c\u7684\u529f\u80fd\u9700\u6c42\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u53ef\u4ee5\u4e0eNetty\u7ed3\u5408\u4f7f\u7528\u7684\u6846\u67b6&#xff1a;<\/p>\n<li>Spring Boot&#xff1a;\u901a\u8fc7Spring Boot\u96c6\u6210Netty&#xff0c;\u53ef\u4ee5\u5229\u7528Spring Boot\u7684\u81ea\u52a8\u914d\u7f6e\u3001\u7ba1\u7406\u7b49\u529f\u80fd\u7b80\u5316Netty\u5e94\u7528\u7684\u5f00\u53d1\u548c\u7ba1\u7406\u3002<\/li>\n<li>MyBatis&#xff1a;MyBatis\u662f\u4e00\u4e2a\u4f18\u79c0\u7684\u6301\u4e45\u5c42\u6846\u67b6&#xff0c;\u5b83\u53ef\u4ee5\u4e0eNetty\u7ed3\u5408\u4f7f\u7528&#xff0c;\u5904\u7406\u6570\u636e\u5e93\u64cd\u4f5c&#xff0c;\u9002\u7528\u4e8e\u9700\u8981\u7f51\u7edc\u901a\u4fe1\u5e76\u4e14\u6d89\u53ca\u5230\u6570\u636e\u6301\u4e45\u5316\u7684\u573a\u666f\u3002<\/li>\n<li>Dubbo&#xff1a;Dubbo\u662f\u963f\u91cc\u5df4\u5df4\u5f00\u6e90\u7684\u4e00\u4e2a\u5206\u5e03\u5f0f\u670d\u52a1\u6846\u67b6&#xff0c;\u5b83\u652f\u6301\u591a\u79cd\u534f\u8bae&#xff0c;\u5305\u62ecNetty\u3002\u901a\u8fc7Netty\u4f20\u8f93RPC\u8c03\u7528&#xff0c;\u53ef\u4ee5\u5b9e\u73b0\u9ad8\u6548\u7684\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528\u3002<\/li>\n<li>gRPC&#xff1a;gRPC\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u3001\u901a\u7528\u7684\u5f00\u6e90RPC\u6846\u67b6&#xff0c;\u5176\u6838\u5fc3\u662f\u57fa\u4e8eHTTP\/2\u534f\u8bae\u8bbe\u8ba1\u7684\u3002Netty\u53ef\u4ee5\u4f5c\u4e3agRPC\u7684\u5e95\u5c42\u4f20\u8f93\u5b9e\u73b0&#xff0c;\u63d0\u4f9b\u9ad8\u6548\u7684\u7f51\u7edc\u901a\u4fe1\u80fd\u529b\u3002<\/li>\n<li>Vert.x&#xff1a;Vert.x\u662f\u4e00\u4e2a\u7528\u4e8e\u6784\u5efa\u53cd\u5e94\u5f0f\u5e94\u7528\u7a0b\u5e8f\u7684\u5de5\u5177\u5305&#xff0c;\u5b83\u4e5f\u53ef\u4ee5\u4f7f\u7528Netty\u4f5c\u4e3a\u5176\u5e95\u5c42\u7684TCP\/UDP\u4f20\u8f93\u5b9e\u73b0\u3002<\/li>\n<p>Netty\u4e0eSpring Boot\u7684\u96c6\u6210\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0&#xff0c;\u5176\u4e2d\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u5982spring-boot-starter-netty\u3002\u4ee5\u4e0b\u662f\u96c6\u6210\u7684\u57fa\u672c\u6b65\u9aa4&#xff1a;<\/p>\n<li>\n<p>\u6dfb\u52a0\u4f9d\u8d56&#xff1a;\u9996\u5148&#xff0c;\u5728\u4f60\u7684Spring Boot\u9879\u76ee\u7684pom.xml\u6587\u4ef6\u4e2d\u6dfb\u52a0Netty\u76f8\u5173\u7684\u4f9d\u8d56\u3002\u4f8b\u5982&#xff0c;\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fMaven&#xff0c;\u53ef\u4ee5\u6dfb\u52a0\u5982\u4e0b\u4f9d\u8d56&#xff1a;<\/p>\n<p> <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>io.netty<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>netty-all<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>4.1.63.Final<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>\n <\/li>\n<li>\n<p>\u914d\u7f6eNetty\u670d\u52a1\u5668&#xff1a;\u5728Spring Boot\u5e94\u7528\u4e2d&#xff0c;\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u7c7b\u6765\u8bbe\u7f6e\u548c\u542f\u52a8Netty\u670d\u52a1\u5668\u3002\u8fd9\u4e2a\u7c7b\u9700\u8981\u5b9e\u73b0WebSocketInitializer\u63a5\u53e3&#xff0c;\u5e76\u91cd\u5199init\u65b9\u6cd5\u6765\u6dfb\u52a0\u81ea\u5b9a\u4e49\u7684ChannelHandler\u3002<\/p>\n<p> <span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>springframework<span class=\"token punctuation\">.<\/span>web<span class=\"token punctuation\">.<\/span>socket<span class=\"token punctuation\">.<\/span>server<span class=\"token punctuation\">.<\/span>standard<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">ServerEndpointExporter<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>springframework<span class=\"token punctuation\">.<\/span>web<span class=\"token punctuation\">.<\/span>socket<span class=\"token punctuation\">.<\/span>server<span class=\"token punctuation\">.<\/span>standard<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">ServerEndpointRegistration<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>springframework<span class=\"token punctuation\">.<\/span>context<span class=\"token punctuation\">.<\/span>annotation<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">Bean<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>springframework<span class=\"token punctuation\">.<\/span>context<span class=\"token punctuation\">.<\/span>annotation<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">Configuration<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">io<span class=\"token punctuation\">.<\/span>netty<span class=\"token punctuation\">.<\/span>channel<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">ChannelInitializer<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">io<span class=\"token punctuation\">.<\/span>netty<span class=\"token punctuation\">.<\/span>channel<span class=\"token punctuation\">.<\/span>socket<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">SocketChannel<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">io<span class=\"token punctuation\">.<\/span>netty<span class=\"token punctuation\">.<\/span>handler<span class=\"token punctuation\">.<\/span>codec<span class=\"token punctuation\">.<\/span>http<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">HttpObjectAggregator<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">io<span class=\"token punctuation\">.<\/span>netty<span class=\"token punctuation\">.<\/span>handler<span class=\"token punctuation\">.<\/span>codec<span class=\"token punctuation\">.<\/span>http<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">HttpServerCodec<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">io<span class=\"token punctuation\">.<\/span>netty<span class=\"token punctuation\">.<\/span>handler<span class=\"token punctuation\">.<\/span>codec<span class=\"token punctuation\">.<\/span>http<span class=\"token punctuation\">.<\/span>websocketx<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">WebSocketFrameAggregator<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">io<span class=\"token punctuation\">.<\/span>netty<span class=\"token punctuation\">.<\/span>handler<span class=\"token punctuation\">.<\/span>stream<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">ChunkedWriteHandler<\/span><\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token annotation punctuation\">&#064;Configuration<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">NettyConfig<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Bean<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token class-name\">ServerEndpointExporter<\/span> <span class=\"token function\">serverEndpointExporter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">ServerEndpointExporter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Bean<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token class-name\">ServerEndpointRegistration<\/span> <span class=\"token function\">customServerEndpoint<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">ServerEndpointRegistration<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\/custom&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">CustomServerEndpoint<\/span><span class=\"token punctuation\">.<\/span><span class=\"token keyword\">class<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Bean<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token class-name\">ChannelInitializer<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">SocketChannel<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> <span class=\"token function\">channelInitializer<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">ChannelInitializer<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">SocketChannel<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token annotation punctuation\">&#064;Override<\/span><br \/>\n            <span class=\"token keyword\">protected<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">initChannel<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">SocketChannel<\/span> ch<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">Exception<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                ch<span class=\"token punctuation\">.<\/span><span class=\"token function\">pipeline<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">addLast<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">new<\/span> <span class=\"token class-name\">HttpServerCodec<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                ch<span class=\"token punctuation\">.<\/span><span class=\"token function\">pipeline<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">addLast<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">new<\/span> <span class=\"token class-name\">ChunkedWriteHandler<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                ch<span class=\"token punctuation\">.<\/span><span class=\"token function\">pipeline<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">addLast<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">new<\/span> <span class=\"token class-name\">HttpObjectAggregator<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">65536<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                ch<span class=\"token punctuation\">.<\/span><span class=\"token function\">pipeline<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">addLast<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">new<\/span> <span class=\"token class-name\">WebSocketFrameAggregator<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">65536<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                <span class=\"token comment\">\/\/ \u8fd9\u91cc\u53ef\u4ee5\u6dfb\u52a0\u66f4\u591a\u81ea\u5b9a\u4e49\u7684\u5904\u7406\u5668<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n<li>\n<p>\u521b\u5efaWebSocket\u7aef\u70b9&#xff1a;\u5b9a\u4e49\u4e00\u4e2a\u7ee7\u627f\u81eaWebSocketEndpoint\u7684\u7c7b&#xff0c;\u7528\u4e8e\u5904\u7406WebSocket\u8fde\u63a5\u548c\u6d88\u606f\u3002<\/p>\n<p> <span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">javax<span class=\"token punctuation\">.<\/span>websocket<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">OnMessage<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">javax<span class=\"token punctuation\">.<\/span>websocket<span class=\"token punctuation\">.<\/span>server<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">ServerEndpoint<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">java<span class=\"token punctuation\">.<\/span>io<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">IOException<\/span><\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token annotation punctuation\">&#064;ServerEndpoint<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\/custom&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">CustomServerEndpoint<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;OnMessage<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">onMessage<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> message<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">Session<\/span> session<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">IOException<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        session<span class=\"token punctuation\">.<\/span><span class=\"token function\">getBasicRemote<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">sendText<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Received: &#034;<\/span> <span class=\"token operator\">&#043;<\/span> message<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u5728Spring Boot\u5e94\u7528\u4e2d\u96c6\u6210Netty&#xff0c;\u5229\u7528Netty\u7684\u9ad8\u6027\u80fd\u7f51\u7edc\u901a\u4fe1\u80fd\u529b\u6765\u5904\u7406WebSocket\u8fde\u63a5\u7b49\u9700\u6c42\u3002 Netty\u4e0eSpring Boot\u96c6\u6210\u7684\u4f18\u52bf\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762&#xff1a;<\/p>\n<li>\n<p>\u9ad8\u6027\u80fd\u548c\u9ad8\u5e76\u53d1&#xff1a;Netty\u662f\u57fa\u4e8eNIO&#xff08;\u975e\u963b\u585eI\/O&#xff09;\u7684\u5ba2\u6237\u7aef-\u670d\u52a1\u5668\u7f16\u7a0b\u6846\u67b6&#xff0c;\u5b83\u652f\u6301\u5f02\u6b65\u901a\u4fe1&#xff0c;\u80fd\u591f\u5904\u7406\u5927\u91cf\u7684\u5e76\u53d1\u8fde\u63a5\u3002\u8fd9\u4f7f\u5f97Netty\u975e\u5e38\u9002\u5408\u7528\u4e8e\u9700\u8981\u9ad8\u6027\u80fd\u548c\u9ad8\u5e76\u53d1\u7684\u573a\u666f&#xff0c;\u4f8b\u5982\u5b9e\u65f6\u901a\u8baf\u3001\u5728\u7ebf\u6e38\u620f\u7b49\u3002<\/p>\n<\/li>\n<li>\n<p>\u6613\u7528\u6027&#xff1a;\u901a\u8fc7Spring Boot\u96c6\u6210Netty&#xff0c;\u53ef\u4ee5\u5229\u7528Spring Boot\u7684\u81ea\u52a8\u914d\u7f6e\u548c\u4f9d\u8d56\u6ce8\u5165\u7279\u6027&#xff0c;\u7b80\u5316\u4e86Netty\u7684\u4f7f\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u66f4\u52a0\u4e13\u6ce8\u4e8e\u4e1a\u52a1\u903b\u8f91\u7684\u5b9e\u73b0&#xff0c;\u800c\u4e0d\u9700\u8981\u5173\u5fc3\u5e95\u5c42\u7684\u7f51\u7edc\u901a\u4fe1\u7ec6\u8282\u3002<\/p>\n<\/li>\n<li>\n<p>\u7075\u6d3b\u6027&#xff1a;Netty\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u6269\u5c55\u70b9&#xff0c;\u53ef\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u7f51\u7edc\u901a\u4fe1\u9700\u6c42\u3002\u540c\u65f6&#xff0c;Spring Boot\u7684\u751f\u6001\u7cfb\u7edf\u4e30\u5bcc&#xff0c;\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0e\u5176\u4ed6Spring\u7ec4\u4ef6\u8fdb\u884c\u96c6\u6210&#xff0c;\u5982Spring Data\u3001Spring Security\u7b49&#xff0c;\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\u548c\u7cfb\u7edf\u7684\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u793e\u533a\u652f\u6301&#xff1a;Netty\u548cSpring Boot\u90fd\u662f\u975e\u5e38\u6210\u719f\u7684\u5f00\u6e90\u9879\u76ee&#xff0c;\u62e5\u6709\u6d3b\u8dc3\u7684\u793e\u533a\u548c\u4e30\u5bcc\u7684\u6587\u6863\u8d44\u6e90\u3002\u8fd9\u610f\u5473\u7740\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9047\u5230\u95ee\u9898\u65f6&#xff0c;\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u627e\u5230\u89e3\u51b3\u65b9\u6848\u6216\u83b7\u5f97\u793e\u533a\u7684\u5e2e\u52a9\u3002<\/p>\n<\/li>\n<p>Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6&#xff0c;\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u3002\u5b83\u901a\u8fc7\u975e\u963b\u585eI\/O\u64cd\u4f5c\u548c\u4e8b\u4ef6\u9a71\u52a8\u673a\u5236\u6765\u5b9e\u73b0\u9ad8\u6548\u7684\u5f02\u6b65\u901a\u4fe1\u3002\u4ee5\u4e0b\u662fNetty\u5b9e\u73b0\u5f02\u6b65\u901a\u4fe1\u7684\u51e0\u4e2a\u5173\u952e\u673a\u5236&#xff1a;<\/p>\n<li>\n<p>\u975e\u963b\u585eI\/O: Netty\u4f7f\u7528Java NIO&#xff08;\u975e\u963b\u585eI\/O&#xff09;\u6765\u5904\u7406\u7f51\u7edc\u901a\u4fe1&#xff0c;\u8fd9\u610f\u5473\u7740\u5b83\u4e0d\u4f1a\u5728\u8bfb\u5199\u64cd\u4f5c\u4e0a\u963b\u585e\u7ebf\u7a0b&#xff0c;\u4ece\u800c\u63d0\u9ad8\u4e86\u6027\u80fd\u548c\u8d44\u6e90\u5229\u7528\u7387\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e8b\u4ef6\u9a71\u52a8\u6a21\u578b: Netty\u91c7\u7528\u4e8b\u4ef6\u9a71\u52a8\u6a21\u578b\u6765\u5904\u7406\u7f51\u7edc\u4e8b\u4ef6&#xff0c;\u5982\u8fde\u63a5\u3001\u8bfb\u53d6\u3001\u5199\u5165\u7b49\u3002\u5f53\u8fd9\u4e9b\u4e8b\u4ef6\u53d1\u751f\u65f6&#xff0c;\u4f1a\u89e6\u53d1\u76f8\u5e94\u7684\u4e8b\u4ef6\u5904\u7406\u5668&#xff08;Handler&#xff09;&#xff0c;\u4ece\u800c\u8fdb\u884c\u76f8\u5e94\u7684\u5904\u7406\u3002<\/p>\n<\/li>\n<li>\n<p>Channel\u548cPipeline: Netty\u4e2d\u7684Channel\u4ee3\u8868\u4e86\u7f51\u7edc\u5957\u63a5\u5b57&#xff0c;\u662f\u6570\u636e\u8bfb\u5199\u7684\u57fa\u672c\u5355\u4f4d\u3002Pipeline\u5219\u662f\u5904\u7406Channel\u4e2d\u4e8b\u4ef6\u7684\u94fe\u5f0f\u7ed3\u6784&#xff0c;\u5305\u542b\u4e86\u591a\u4e2aHandler&#xff0c;\u6bcf\u4e2aHandler\u8d1f\u8d23\u5904\u7406\u7279\u5b9a\u7c7b\u578b\u7684\u4e8b\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p>Selector\u673a\u5236: Netty\u5185\u90e8\u4f7f\u7528Selector\u673a\u5236\u6765\u7ba1\u7406\u591a\u4e2aChannel&#xff0c;Selector\u53ef\u4ee5\u76d1\u63a7\u591a\u4e2aChannel\u7684\u4e8b\u4ef6&#xff0c;\u5f53\u67d0\u4e2aChannel\u5c31\u7eea\u65f6&#xff0c;\u5b83\u4f1a\u901a\u77e5\u5e94\u7528\u7a0b\u5e8f\u8fdb\u884c\u76f8\u5e94\u7684\u8bfb\u5199\u64cd\u4f5c\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ebf\u7a0b\u6a21\u578b: Netty\u652f\u6301\u591a\u79cd\u7ebf\u7a0b\u6a21\u578b&#xff0c;\u5305\u62ec\u5355\u7ebf\u7a0b\u3001\u591a\u7ebf\u7a0b\u548c\u4e3b\u4ece\u7ebf\u7a0b\u6a21\u578b&#xff0c;\u53ef\u4ee5\u6839\u636e\u5e94\u7528\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u7ebf\u7a0b\u6a21\u578b\u6765\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<\/li>\n<li>\n<p>ByteBuf\u7f13\u51b2\u533a: Netty\u4f7f\u7528ByteBuf\u4f5c\u4e3a\u6570\u636e\u4f20\u8f93\u7684\u7f13\u51b2\u533a&#xff0c;\u5b83\u662f\u4e00\u4e2a\u5f15\u7528\u8ba1\u6570\u7684\u5b57\u8282\u7f13\u51b2\u533a&#xff0c;\u53ef\u4ee5\u51cf\u5c11\u5185\u5b58\u590d\u5236\u548c\u5783\u573e\u56de\u6536&#xff0c;\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<\/li>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u673a\u5236&#xff0c;Netty\u80fd\u591f\u5b9e\u73b0\u9ad8\u6548\u3001\u7075\u6d3b\u7684\u5f02\u6b65\u901a\u4fe1&#xff0c;\u9002\u7528\u4e8e\u6784\u5efa\u9ad8\u6027\u80fd\u7684\u7f51\u7edc\u5e94\u7528\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418181257-6802962945fe8.jpg\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb889\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u540c\u65f6\uff0cSpring Boot\u7684\u751f\u6001\u7cfb\u7edf\u4e30\u5bcc\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0e\u5176\u4ed6Spring\u7ec4\u4ef6\u8fdb\u884c\u96c6\u6210\uff0c\u5982Spring Data\u3001Spring Security\u7b49\uff0c\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\u548c\u7cfb\u7edf\u7684\u53ef\u7ef4\u62a4\u6027\u3002\uff1a\u901a\u8fc7Spring Boot\u96c6\u6210Netty\uff0c\u53ef\u4ee5\u5229\u7528Spring Boot\u7684\u81ea\u52a8\u914d\u7f6e\u548c\u4f9d\u8d56\u6ce8\u5165\u7279\u6027\uff0c\u7b80\u5316\u4e86Netty\u7684\u4f7f\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\u3002\u5b83\u80fd\u591f\u4e0e\u591a\u79cd\u6846\u67b6\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u5b9e\u73b0\u4e0d\u540c\u7684\u529f\u80fd\u9700\u6c42\u3002Netty\u4e0eSpring Boot\u7684\u96c6\u6210\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5176\u4e2d\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u5982spring-boot-starter-netty\u3002<\/p>\n","protected":false},"author":2,"featured_media":19749,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1203,99,1526,1527,190,43],"topic":[],"class_list":["post-19750","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ioinput-output","tag-java","tag-nettylow-of-the-netty","tag-springboottomcatjettyservlet","tag-190","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/19750.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb889\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u540c\u65f6\uff0cSpring Boot\u7684\u751f\u6001\u7cfb\u7edf\u4e30\u5bcc\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0e\u5176\u4ed6Spring\u7ec4\u4ef6\u8fdb\u884c\u96c6\u6210\uff0c\u5982Spring Data\u3001Spring Security\u7b49\uff0c\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\u548c\u7cfb\u7edf\u7684\u53ef\u7ef4\u62a4\u6027\u3002\uff1a\u901a\u8fc7Spring Boot\u96c6\u6210Netty\uff0c\u53ef\u4ee5\u5229\u7528Spring Boot\u7684\u81ea\u52a8\u914d\u7f6e\u548c\u4f9d\u8d56\u6ce8\u5165\u7279\u6027\uff0c\u7b80\u5316\u4e86Netty\u7684\u4f7f\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\u3002\u5b83\u80fd\u591f\u4e0e\u591a\u79cd\u6846\u67b6\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u5b9e\u73b0\u4e0d\u540c\u7684\u529f\u80fd\u9700\u6c42\u3002Netty\u4e0eSpring Boot\u7684\u96c6\u6210\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5176\u4e2d\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u5982spring-boot-starter-netty\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/19750.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T18:12:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418181257-6802962945fe8.jpg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/19750.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/19750.html\",\"name\":\"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T18:12:59+00:00\",\"dateModified\":\"2025-04-18T18:12:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/19750.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/19750.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/19750.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/19750.html","og_locale":"zh_CN","og_type":"article","og_title":"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb889\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u540c\u65f6\uff0cSpring Boot\u7684\u751f\u6001\u7cfb\u7edf\u4e30\u5bcc\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0e\u5176\u4ed6Spring\u7ec4\u4ef6\u8fdb\u884c\u96c6\u6210\uff0c\u5982Spring Data\u3001Spring Security\u7b49\uff0c\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\u548c\u7cfb\u7edf\u7684\u53ef\u7ef4\u62a4\u6027\u3002\uff1a\u901a\u8fc7Spring Boot\u96c6\u6210Netty\uff0c\u53ef\u4ee5\u5229\u7528Spring Boot\u7684\u81ea\u52a8\u914d\u7f6e\u548c\u4f9d\u8d56\u6ce8\u5165\u7279\u6027\uff0c\u7b80\u5316\u4e86Netty\u7684\u4f7f\u7528\u548c\u914d\u7f6e\u8fc7\u7a0b\u3002\u5b83\u80fd\u591f\u4e0e\u591a\u79cd\u6846\u67b6\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u5b9e\u73b0\u4e0d\u540c\u7684\u529f\u80fd\u9700\u6c42\u3002Netty\u4e0eSpring Boot\u7684\u96c6\u6210\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5176\u4e2d\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u5982spring-boot-starter-netty\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/19750.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T18:12:59+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418181257-6802962945fe8.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/19750.html","url":"https:\/\/www.wsisp.com\/helps\/19750.html","name":"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T18:12:59+00:00","dateModified":"2025-04-18T18:12:59+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/19750.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/19750.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/19750.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Netty\u662f\u4e00\u4e2a\u57fa\u4e8eJava\u7684\u5f02\u6b65\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f51\u7edc\u5e94\u7528\u6846\u67b6\uff0c\u7528\u4e8e\u5feb\u901f\u5f00\u53d1\u53ef\u7ef4\u62a4\u7684\u9ad8\u6027\u80fd\u534f\u8bae\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/19750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=19750"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/19750\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/19749"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=19750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=19750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=19750"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=19750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}