{"id":37117,"date":"2025-05-14T07:26:13","date_gmt":"2025-05-13T23:26:13","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/37117.html"},"modified":"2025-05-14T07:26:13","modified_gmt":"2025-05-13T23:26:13","slug":"java%e6%b8%b8%e6%88%8f%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%bc%80%e5%8f%91%e6%b5%81%e6%b0%b4%e8%b4%a66%e7%bd%91%e5%85%b3%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%ae%80%e4%bb%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/37117.html","title":{"rendered":"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb"},"content":{"rendered":"<p>\u5728 Java \u6e38\u620f\u670d\u52a1\u5668\u67b6\u6784\u4e2d&#xff0c;\u7f51\u5173\u670d\u52a1\u5668\u662f\u8fde\u63a5\u5ba2\u6237\u7aef\u4e0e\u540e\u7aef\u670d\u52a1\u7684\u5173\u952e\u7ec4\u4ef6&#xff0c;\u8d1f\u8d23\u5904\u7406\u7f51\u7edc\u901a\u4fe1\u3001\u534f\u8bae\u89e3\u6790\u548c\u8bf7\u6c42\u8def\u7531\u3002<\/p>\n<h4>1. \u7f51\u5173\u670d\u52a1\u5668\u7684\u6838\u5fc3\u804c\u8d23<\/h4>\n<ul>\n<li>\u7f51\u7edc\u901a\u4fe1\u7ba1\u7406&#xff1a;\u5904\u7406 TCP\/UDP\/WebSocket \u8fde\u63a5&#xff0c;\u7ef4\u62a4\u5ba2\u6237\u7aef\u4f1a\u8bdd\u72b6\u6001\u3002<\/li>\n<li>\u534f\u8bae\u89e3\u6790\u4e0e\u5e8f\u5217\u5316&#xff1a;\u89e3\u6790\u6e38\u620f\u534f\u8bae&#xff08;\u5982 Protobuf\u3001JSON&#xff09;&#xff0c;\u5904\u7406\u7c98\u5305 \/ \u534a\u5305\u95ee\u9898\u3002<\/li>\n<li>\u8bf7\u6c42\u8def\u7531&#xff1a;\u5c06\u5ba2\u6237\u7aef\u8bf7\u6c42\u8f6c\u53d1\u81f3\u5bf9\u5e94\u7684\u903b\u8f91\u670d\u52a1\u5668&#xff08;\u5982\u767b\u5f55\u670d\u3001\u6e38\u620f\u670d&#xff09;\u3002<\/li>\n<li>\u8d1f\u8f7d\u5747\u8861&#xff1a;\u6839\u636e\u540e\u7aef\u670d\u52a1\u5668\u8d1f\u8f7d\u52a8\u6001\u5206\u914d\u8bf7\u6c42&#xff0c;\u907f\u514d\u5355\u70b9\u538b\u529b\u8fc7\u5927\u3002<\/li>\n<li>\u5b89\u5168\u9632\u62a4&#xff1a;\u8fc7\u6ee4\u6076\u610f\u8bf7\u6c42\u3001\u9632\u6b62 DDOS \u653b\u51fb\u3001\u9a8c\u8bc1\u5ba2\u6237\u7aef\u5408\u6cd5\u6027\u3002<\/li>\n<\/ul>\n<h4>2. \u67b6\u6784\u8bbe\u8ba1<\/h4>\n<h5>\u5178\u578b\u5206\u5c42\u67b6\u6784<\/h5>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  \u5ba2\u6237\u7aef (\u624b\u673a\/PC) \u2502\u2500\u2500\u2500\u2192\u2502  \u7f51\u5173\u670d\u52a1\u5668\u96c6\u7fa4   \u2502\u2500\u2500\u2500\u2192\u2502  \u903b\u8f91\u670d\u52a1\u5668\u96c6\u7fa4   \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n                          \u2502       \u2191<br \/>\n                          \u2193       \u2502<br \/>\n                      \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n                      \u2502  \u6ce8\u518c\u4e2d\u5fc3\/\u914d\u7f6e\u4e2d\u5fc3 \u2502<br \/>\n                      \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<h5>\u5173\u952e\u7ec4\u4ef6<\/h5>\n<ul>\n<li>\u7f51\u7edc\u5c42&#xff1a;\u57fa\u4e8e Netty \u6216 Mina \u5b9e\u73b0\u9ad8\u6027\u80fd\u7f51\u7edc\u901a\u4fe1\u3002<\/li>\n<li>\u534f\u8bae\u5c42&#xff1a;\u652f\u6301\u591a\u534f\u8bae\u89e3\u6790&#xff08;\u5982 HTTP\u3001WebSocket\u3001\u81ea\u5b9a\u4e49\u4e8c\u8fdb\u5236\u534f\u8bae&#xff09;\u3002<\/li>\n<li>\u4f1a\u8bdd\u7ba1\u7406&#xff1a;\u7ef4\u62a4\u5ba2\u6237\u7aef\u8fde\u63a5\u72b6\u6001&#xff0c;\u5b9e\u73b0 SessionID \u4e0e\u8fde\u63a5\u7684\u6620\u5c04\u3002<\/li>\n<li>\u6d88\u606f\u8def\u7531&#xff1a;\u6839\u636e\u6d88\u606f\u7c7b\u578b\u5c06\u8bf7\u6c42\u8f6c\u53d1\u81f3\u5bf9\u5e94\u7684\u4e1a\u52a1\u5904\u7406\u5668\u3002<\/li>\n<li>\u76d1\u63a7\u7edf\u8ba1&#xff1a;\u6536\u96c6\u8fde\u63a5\u6570\u3001\u6d41\u91cf\u3001\u54cd\u5e94\u65f6\u95f4\u7b49\u6307\u6807\u3002<\/li>\n<\/ul>\n<h4>3. \u6838\u5fc3\u529f\u80fd\u5b9e\u73b0<\/h4>\n<h5>3.1 \u57fa\u4e8e Netty \u7684\u9ad8\u6027\u80fd\u7f51\u7edc\u5c42<\/h5>\n<p>Netty \u662f Java \u9886\u57df\u6700\u6d41\u884c\u7684\u9ad8\u6027\u80fd\u7f51\u7edc\u6846\u67b6&#xff0c;\u9002\u5408\u5904\u7406\u6d77\u91cf\u5e76\u53d1\u8fde\u63a5&#xff1a;<\/p>\n<p>import io.netty.bootstrap.ServerBootstrap;<br \/>\nimport io.netty.channel.*;<br \/>\nimport io.netty.channel.nio.NioEventLoopGroup;<br \/>\nimport io.netty.channel.socket.SocketChannel;<br \/>\nimport io.netty.channel.socket.nio.NioServerSocketChannel;<br \/>\nimport io.netty.handler.codec.LengthFieldBasedFrameDecoder;<br \/>\nimport io.netty.handler.timeout.IdleStateHandler;<\/p>\n<p>public class GatewayServer {<br \/>\n    private final int port;<br \/>\n    private EventLoopGroup bossGroup;<br \/>\n    private EventLoopGroup workerGroup;<\/p>\n<p>    public GatewayServer(int port) {<br \/>\n        this.port &#061; port;<br \/>\n    }<\/p>\n<p>    public void start() throws Exception {<br \/>\n        bossGroup &#061; new NioEventLoopGroup(); \/\/ \u63a5\u6536\u8fde\u63a5\u7684\u7ebf\u7a0b\u7ec4<br \/>\n        workerGroup &#061; new NioEventLoopGroup(); \/\/ \u5904\u7406\u8fde\u63a5\u7684\u7ebf\u7a0b\u7ec4<\/p>\n<p>        try {<br \/>\n            ServerBootstrap b &#061; new ServerBootstrap();<br \/>\n            b.group(bossGroup, workerGroup)<br \/>\n             .channel(NioServerSocketChannel.class)<br \/>\n             .childHandler(new ChannelInitializer&lt;SocketChannel&gt;() {<br \/>\n                &#064;Override<br \/>\n                public void initChannel(SocketChannel ch) throws Exception {<br \/>\n                    ChannelPipeline pipeline &#061; ch.pipeline();<\/p>\n<p>                    \/\/ \u5904\u7406\u7c98\u5305\/\u534a\u5305\u95ee\u9898<br \/>\n                    pipeline.addLast(new LengthFieldBasedFrameDecoder(<br \/>\n                        1024 * 1024, 0, 4, 0, 4));<\/p>\n<p>                    \/\/ \u5fc3\u8df3\u68c0\u6d4b&#xff08;30\u79d2\u65e0\u8bfb\u64cd\u4f5c\u5219\u65ad\u5f00&#xff09;<br \/>\n                    pipeline.addLast(new IdleStateHandler(30, 0, 0));<\/p>\n<p>                    \/\/ \u81ea\u5b9a\u4e49\u7f16\u7801\u5668\/\u89e3\u7801\u5668<br \/>\n                    pipeline.addLast(new GameProtocolDecoder());<br \/>\n                    pipeline.addLast(new GameProtocolEncoder());<\/p>\n<p>                    \/\/ \u4e1a\u52a1\u5904\u7406\u5668<br \/>\n                    pipeline.addLast(new GatewayHandler());<br \/>\n                }<br \/>\n             })<br \/>\n             .option(ChannelOption.SO_BACKLOG, 128)<br \/>\n             .childOption(ChannelOption.SO_KEEPALIVE, true);<\/p>\n<p>            \/\/ \u7ed1\u5b9a\u7aef\u53e3&#xff0c;\u5f00\u59cb\u63a5\u6536\u8fde\u63a5<br \/>\n            ChannelFuture f &#061; b.bind(port).sync();<br \/>\n            System.out.println(&#034;\u7f51\u5173\u670d\u52a1\u5668\u542f\u52a8&#xff0c;\u76d1\u542c\u7aef\u53e3: &#034; &#043; port);<\/p>\n<p>            \/\/ \u7b49\u5f85\u670d\u52a1\u5668\u5173\u95ed<br \/>\n            f.channel().closeFuture().sync();<br \/>\n        } finally {<br \/>\n            workerGroup.shutdownGracefully();<br \/>\n            bossGroup.shutdownGracefully();<br \/>\n        }<br \/>\n    }<\/p>\n<p>    public static void main(String[] args) throws Exception {<br \/>\n        new GatewayServer(8080).start();<br \/>\n    }<br \/>\n}<\/p>\n<h5>3.2 \u534f\u8bae\u89e3\u6790\u4e0e\u6d88\u606f\u5904\u7406<\/h5>\n<p>\u4f7f\u7528 Protobuf \u4f5c\u4e3a\u6e38\u620f\u534f\u8bae&#xff0c;\u5904\u7406\u5ba2\u6237\u7aef\u8bf7\u6c42\u5e76\u8def\u7531\u5230\u540e\u7aef\u670d\u52a1&#xff1a;<\/p>\n<p>import com.google.protobuf.Message;<br \/>\nimport io.netty.channel.ChannelHandlerContext;<br \/>\nimport io.netty.channel.SimpleChannelInboundHandler;<\/p>\n<p>public class GatewayHandler extends SimpleChannelInboundHandler&lt;GameMessage&gt; {<br \/>\n    private final ServiceRouter serviceRouter;<\/p>\n<p>    public GatewayHandler() {<br \/>\n        this.serviceRouter &#061; new ServiceRouter(); \/\/ \u670d\u52a1\u8def\u7531\u7ec4\u4ef6<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    protected void channelRead0(ChannelHandlerContext ctx, GameMessage msg) throws Exception {<br \/>\n        \/\/ \u83b7\u53d6\u4f1a\u8bddID&#xff08;\u53ef\u4ece\u8fde\u63a5\u5c5e\u6027\u6216\u6d88\u606f\u4e2d\u63d0\u53d6&#xff09;<br \/>\n        String sessionId &#061; getSessionId(ctx);<\/p>\n<p>        \/\/ \u6839\u636e\u6d88\u606f\u7c7b\u578b\u8def\u7531\u5230\u4e0d\u540c\u7684\u670d\u52a1<br \/>\n        Message response &#061; serviceRouter.route(sessionId, msg);<\/p>\n<p>        \/\/ \u8fd4\u56de\u54cd\u5e94\u7ed9\u5ba2\u6237\u7aef<br \/>\n        if (response !&#061; null) {<br \/>\n            ctx.writeAndFlush(response);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {<br \/>\n        cause.printStackTrace();<br \/>\n        ctx.close();<br \/>\n    }<\/p>\n<p>    private String getSessionId(ChannelHandlerContext ctx) {<br \/>\n        \/\/ \u4eceChannel\u5c5e\u6027\u4e2d\u83b7\u53d6\u4f1a\u8bddID<br \/>\n        return ctx.channel().attr(AttributeKey.valueOf(&#034;SESSION_ID&#034;)).get();<br \/>\n    }<br \/>\n}<\/p>\n<h5>3.3 \u670d\u52a1\u6ce8\u518c\u4e0e\u53d1\u73b0<\/h5>\n<p>\u4f7f\u7528 Consul \u6216 Nacos \u5b9e\u73b0\u7f51\u5173\u4e0e\u540e\u7aef\u670d\u52a1\u7684\u52a8\u6001\u6ce8\u518c\u4e0e\u53d1\u73b0&#xff1a;<\/p>\n<p>import com.orbitz.consul.Consul;<br \/>\nimport com.orbitz.consul.model.agent.ImmutableRegistration;<\/p>\n<p>public class ServiceRegistry {<br \/>\n    private final Consul consul;<\/p>\n<p>    public ServiceRegistry(String consulHost, int consulPort) {<br \/>\n        this.consul &#061; Consul.builder().withHostAndPort(<br \/>\n            com.orbitz.consul.model.ConsulHostAndPort.of(consulHost, consulPort)<br \/>\n        ).build();<br \/>\n    }<\/p>\n<p>    public void registerGatewayService(String serviceId, String host, int port) {<br \/>\n        \/\/ \u6ce8\u518c\u7f51\u5173\u670d\u52a1\u5230Consul<br \/>\n        ImmutableRegistration registration &#061; ImmutableRegistration.builder()<br \/>\n            .id(serviceId)<br \/>\n            .name(&#034;game-gateway&#034;)<br \/>\n            .address(host)<br \/>\n            .port(port)<br \/>\n            .check(Registration.RegCheck.ttl(30L)) \/\/ \u5065\u5eb7\u68c0\u67e5<br \/>\n            .build();<\/p>\n<p>        consul.agentClient().register(registration);<br \/>\n        System.out.println(&#034;\u7f51\u5173\u670d\u52a1\u5df2\u6ce8\u518c: &#034; &#043; serviceId);<br \/>\n    }<\/p>\n<p>    \/\/ \u53d1\u73b0\u53ef\u7528\u7684\u540e\u7aef\u670d\u52a1<br \/>\n    public List&lt;ServiceInstance&gt; discoverService(String serviceName) {<br \/>\n        return consul.catalogClient().getService(serviceName)<br \/>\n            .getResponse().stream()<br \/>\n            .map(service -&gt; new ServiceInstance(<br \/>\n                service.getService().getAddress(),<br \/>\n                service.getService().getPort()<br \/>\n            ))<br \/>\n            .collect(Collectors.toList());<br \/>\n    }<br \/>\n}<\/p>\n<h5>3.4 \u8d1f\u8f7d\u5747\u8861\u7b56\u7565<\/h5>\n<p>\u5b9e\u73b0\u57fa\u4e8e\u6743\u91cd\u7684\u8d1f\u8f7d\u5747\u8861\u7b97\u6cd5&#xff1a;<\/p>\n<p>import java.util.*;<br \/>\nimport java.util.concurrent.atomic.AtomicInteger;<\/p>\n<p>public class LoadBalancer {<br \/>\n    private final List&lt;ServiceInstance&gt; instances;<br \/>\n    private final AtomicInteger index &#061; new AtomicInteger(0);<\/p>\n<p>    public LoadBalancer(List&lt;ServiceInstance&gt; instances) {<br \/>\n        this.instances &#061; instances;<br \/>\n    }<\/p>\n<p>    \/\/ \u8f6e\u8be2\u7b56\u7565<br \/>\n    public ServiceInstance select() {<br \/>\n        if (instances.isEmpty()) {<br \/>\n            return null;<br \/>\n        }<br \/>\n        int idx &#061; (index.getAndIncrement() % instances.size());<br \/>\n        return instances.get(idx);<br \/>\n    }<\/p>\n<p>    \/\/ \u52a0\u6743\u8f6e\u8be2\u7b56\u7565<br \/>\n    public ServiceInstance selectByWeight() {<br \/>\n        if (instances.isEmpty()) {<br \/>\n            return null;<br \/>\n        }<\/p>\n<p>        \/\/ \u8ba1\u7b97\u603b\u6743\u91cd<br \/>\n        int totalWeight &#061; instances.stream()<br \/>\n            .mapToInt(ServiceInstance::getWeight)<br \/>\n            .sum();<\/p>\n<p>        int random &#061; new Random().nextInt(totalWeight);<br \/>\n        int current &#061; 0;<\/p>\n<p>        for (ServiceInstance instance : instances) {<br \/>\n            current &#043;&#061; instance.getWeight();<br \/>\n            if (random &lt; current) {<br \/>\n                return instance;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        return instances.get(0);<br \/>\n    }<br \/>\n}<\/p>\n<h4>4. \u5b89\u5168\u4e0e\u6027\u80fd\u4f18\u5316<\/h4>\n<h5>4.1 \u5b89\u5168\u9632\u62a4<\/h5>\n<ul>\n<li>IP \u9650\u6d41&#xff1a;\u9650\u5236\u5355\u4e2a IP \u7684\u8fde\u63a5\u6570\u548c\u8bf7\u6c42\u9891\u7387<\/li>\n<li>\u534f\u8bae\u6821\u9a8c&#xff1a;\u9a8c\u8bc1\u6d88\u606f\u683c\u5f0f\u548c\u957f\u5ea6&#xff0c;\u9632\u6b62\u6076\u610f\u6784\u9020<\/li>\n<li>\u6570\u636e\u52a0\u5bc6&#xff1a;\u5bf9\u654f\u611f\u6570\u636e&#xff08;\u5982\u767b\u5f55\u4fe1\u606f&#xff09;\u8fdb\u884c AES \u52a0\u5bc6<\/li>\n<li>DDOS \u9632\u62a4&#xff1a;\u96c6\u6210\u6d41\u91cf\u6e05\u6d17\u6216\u4f7f\u7528\u7b2c\u4e09\u65b9\u9632\u62a4\u670d\u52a1<\/li>\n<\/ul>\n<h5>4.2 \u6027\u80fd\u4f18\u5316<\/h5>\n<ul>\n<li>\u8fde\u63a5\u6c60&#xff1a;\u590d\u7528\u4e0e\u540e\u7aef\u670d\u52a1\u7684\u8fde\u63a5&#xff0c;\u51cf\u5c11\u63e1\u624b\u5f00\u9500<\/li>\n<li>\u5f02\u6b65\u5904\u7406&#xff1a;\u4f7f\u7528 CompletableFuture \u5904\u7406\u8017\u65f6\u64cd\u4f5c<\/li>\n<li>\u6570\u636e\u538b\u7f29&#xff1a;\u5bf9\u5927\u6d88\u606f\u4f53&#xff08;\u5982\u5730\u56fe\u6570\u636e&#xff09;\u8fdb\u884c Zlib \u538b\u7f29<\/li>\n<li>\u5185\u5b58\u4f18\u5316&#xff1a;\u4f7f\u7528 Netty \u7684 ByteBuf \u51cf\u5c11\u5185\u5b58\u62f7\u8d1d<\/li>\n<\/ul>\n<h4>5. \u90e8\u7f72\u4e0e\u76d1\u63a7<\/h4>\n<h5>5.1 \u90e8\u7f72\u67b6\u6784<\/h5>\n<p>\u5ba2\u6237\u7aef &lt;&#8211;&gt; CDN\/WAF &lt;&#8211;&gt; \u8d1f\u8f7d\u5747\u8861\u5668 &lt;&#8211;&gt; \u7f51\u5173\u96c6\u7fa4 &lt;&#8211;&gt; \u670d\u52a1\u6ce8\u518c\u4e2d\u5fc3<br \/>\n                                      |<br \/>\n                                      v<br \/>\n                               \u903b\u8f91\u670d\u52a1\u5668\u96c6\u7fa4<br \/>\n                                      |<br \/>\n                                      v<br \/>\n                               \u6570\u636e\u5e93\/\u7f13\u5b58\u96c6\u7fa4<\/p>\n<h5>5.2 \u76d1\u63a7\u6307\u6807<\/h5>\n<ul>\n<li>\u8fde\u63a5\u6570&#xff1a;\u5f53\u524d\u6d3b\u8dc3\u8fde\u63a5\u6570\u3001\u6700\u5927\u8fde\u63a5\u6570<\/li>\n<li>\u6d41\u91cf&#xff1a;\u5165\u7ad9 \/ \u51fa\u7ad9\u6d41\u91cf\u901f\u7387<\/li>\n<li>\u54cd\u5e94\u65f6\u95f4&#xff1a;\u8bf7\u6c42\u5904\u7406\u5ef6\u8fdf<\/li>\n<li>\u9519\u8bef\u7387&#xff1a;\u5f02\u5e38\u8bf7\u6c42\u6bd4\u4f8b<\/li>\n<\/ul>\n<h4>6. \u6311\u6218\u4e0e\u89e3\u51b3\u65b9\u6848<\/h4>\n<li>\n<p>\u6d77\u91cf\u5e76\u53d1\u8fde\u63a5&#xff1a;<\/p>\n<ul>\n<li>\u4f7f\u7528 Netty \u7684\u4e3b\u4ece Reactor \u591a\u7ebf\u7a0b\u6a21\u578b<\/li>\n<li>\u4f18\u5316 JVM \u53c2\u6570&#xff08;\u5982\u8c03\u6574\u5806\u5927\u5c0f\u3001\u4f7f\u7528 G1 \u5783\u573e\u6536\u96c6\u5668&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5355\u70b9\u6545\u969c&#xff1a;<\/p>\n<ul>\n<li>\u90e8\u7f72\u591a\u4e2a\u7f51\u5173\u5b9e\u4f8b&#xff0c;\u5ba2\u6237\u7aef\u652f\u6301\u81ea\u52a8\u91cd\u8fde<\/li>\n<li>\u4f7f\u7528 Keepalived \u5b9e\u73b0\u4e3b\u5907\u5207\u6362<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8de8\u673a\u623f\u90e8\u7f72&#xff1a;<\/p>\n<ul>\n<li>\u91c7\u7528\u5c31\u8fd1\u63a5\u5165\u539f\u5219&#xff0c;\u5ba2\u6237\u7aef\u9009\u62e9\u5ef6\u8fdf\u6700\u4f4e\u7684\u673a\u623f\u7f51\u5173<\/li>\n<li>\u4f7f\u7528\u5168\u7403\u8d1f\u8f7d\u5747\u8861&#xff08;GSLB&#xff09;\u6280\u672f<\/li>\n<\/ul>\n<\/li>\n<h4>7. \u6280\u672f\u9009\u578b\u5efa\u8bae<\/h4>\n<ul>\n<li>\u7f51\u7edc\u6846\u67b6&#xff1a;Netty&#xff08;\u9ad8\u6027\u80fd&#xff09;\u6216 Mina<\/li>\n<li>\u670d\u52a1\u53d1\u73b0&#xff1a;Consul\u3001Nacos \u6216 Eureka<\/li>\n<li>\u914d\u7f6e\u4e2d\u5fc3&#xff1a;Apollo\u3001Nacos \u6216 ZooKeeper<\/li>\n<li>\u76d1\u63a7\u7cfb\u7edf&#xff1a;Prometheus &#043; Grafana<\/li>\n<li>\u5206\u5e03\u5f0f\u8ffd\u8e2a&#xff1a;Zipkin \u6216 SkyWalking<\/li>\n<\/ul>\n<h4>\u603b\u7ed3<\/h4>\n<p>Java \u7f51\u5173\u670d\u52a1\u5668\u7684\u5f00\u53d1\u9700\u8981\u7efc\u5408\u8003\u8651\u9ad8\u6027\u80fd\u7f51\u7edc\u7f16\u7a0b\u3001\u534f\u8bae\u8bbe\u8ba1\u3001\u670d\u52a1\u6cbb\u7406\u548c\u5b89\u5168\u9632\u62a4\u3002\u901a\u8fc7\u5408\u7406\u7684\u67b6\u6784\u8bbe\u8ba1\u548c\u6280\u672f\u9009\u578b&#xff0c;\u53ef\u4ee5\u6784\u5efa\u51fa\u652f\u6301\u6d77\u91cf\u5e76\u53d1\u3001\u9ad8\u53ef\u7528\u3001\u6613\u6269\u5c55\u7684\u6e38\u620f\u7f51\u5173\u7cfb\u7edf\u3002\u5173\u952e\u5728\u4e8e\u5229\u7528 Netty \u7b49\u9ad8\u6027\u80fd\u6846\u67b6\u5904\u7406\u7f51\u7edc\u901a\u4fe1&#xff0c;\u901a\u8fc7\u670d\u52a1\u6ce8\u518c\u53d1\u73b0\u5b9e\u73b0\u5f39\u6027\u6269\u5c55&#xff0c;\u4ee5\u53ca\u901a\u8fc7\u5b8c\u5584\u7684\u76d1\u63a7\u4f53\u7cfb\u4fdd\u969c\u7cfb\u7edf\u7a33\u5b9a\u8fd0\u884c\u3002\u4e0a\u9762\u7684\u4ee3\u7801\u7247\u6bb5\u4f8b\u5b50\u662f\u7b80\u5355\u7684\u5b9e\u73b0&#xff0c;\u5b9e\u9645\u60c5\u51b5\u4f1a\u56e0\u4e3a\u9700\u6c42\u4e0d\u540c\u800c\u76f8\u5bf9\u66f4\u52a0\u590d\u6742\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e23\u6b21\uff0c\u6536\u85cf8\u6b21\u3002Java\u6e38\u620f\u670d\u52a1\u5668\u67b6\u6784\u4e2d\u7684\u7f51\u5173\u670d\u52a1\u5668\u662f\u8fde\u63a5\u5ba2\u6237\u7aef\u4e0e\u540e\u7aef\u670d\u52a1\u7684\u5173\u952e\u7ec4\u4ef6\uff0c\u4e3b\u8981\u804c\u8d23\u5305\u62ec\u7f51\u7edc\u901a\u4fe1\u7ba1\u7406\u3001\u534f\u8bae\u89e3\u6790\u4e0e\u5e8f\u5217\u5316\u3001\u8bf7\u6c42\u8def\u7531\u3001\u8d1f\u8f7d\u5747\u8861\u548c\u5b89\u5168\u9632\u62a4\u3002\u5178\u578b\u67b6\u6784\u91c7\u7528\u5206\u5c42\u8bbe\u8ba1\uff0c\u5ba2\u6237\u7aef\u901a\u8fc7\u7f51\u5173\u670d\u52a1\u5668\u96c6\u7fa4\u4e0e\u903b\u8f91\u670d\u52a1\u5668\u96c6\u7fa4\u901a\u4fe1\uff0c\u5229\u7528\u6ce8\u518c\u4e2d\u5fc3\u8fdb\u884c\u670d\u52a1\u53d1\u73b0\u3002\u6838\u5fc3\u529f\u80fd\u5b9e\u73b0\u57fa\u4e8eNetty\u7684\u9ad8\u6027\u80fd\u7f51\u7edc\u5c42\uff0c\u652f\u6301\u591a\u534f\u8bae\u89e3\u6790\u548c\u4f1a\u8bdd\u7ba1\u7406\uff0c\u4f7f\u7528Protobuf\u5904\u7406\u6e38\u620f\u534f\u8bae\uff0c\u5e76\u901a\u8fc7\u670d\u52a1\u6ce8\u518c\u4e0e\u53d1\u73b0\u52a8\u6001\u7ba1\u7406\u540e\u7aef\u670d\u52a1\u3002\u5b89\u5168\u9632\u62a4\u63aa\u65bd\u5305\u62ecIP\u9650\u6d41\u3001\u534f\u8bae\u6821\u9a8c\u548c\u6570\u636e\u52a0\u5bc6\uff0c\u6027\u80fd\u4f18\u5316\u5219\u6d89\u53ca\u8fde\u63a5\u6c60\u3001\u5f02\u6b65\u5904\u7406\u548c\u6570\u636e\u538b\u7f29\u3002\u90e8\u7f72\u67b6\u6784\u5305\u62ec\u5ba2\u6237\u7aef\u3001CDN\/WAF\u3001\u8d1f\u8f7d\u5747\u8861\u5668<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3214,99,43,248],"topic":[],"class_list":{"0":"post-37117","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-server","7":"tag-java","9":"tag-43","10":"tag-248"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb - \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\/37117.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e23\u6b21\uff0c\u6536\u85cf8\u6b21\u3002Java\u6e38\u620f\u670d\u52a1\u5668\u67b6\u6784\u4e2d\u7684\u7f51\u5173\u670d\u52a1\u5668\u662f\u8fde\u63a5\u5ba2\u6237\u7aef\u4e0e\u540e\u7aef\u670d\u52a1\u7684\u5173\u952e\u7ec4\u4ef6\uff0c\u4e3b\u8981\u804c\u8d23\u5305\u62ec\u7f51\u7edc\u901a\u4fe1\u7ba1\u7406\u3001\u534f\u8bae\u89e3\u6790\u4e0e\u5e8f\u5217\u5316\u3001\u8bf7\u6c42\u8def\u7531\u3001\u8d1f\u8f7d\u5747\u8861\u548c\u5b89\u5168\u9632\u62a4\u3002\u5178\u578b\u67b6\u6784\u91c7\u7528\u5206\u5c42\u8bbe\u8ba1\uff0c\u5ba2\u6237\u7aef\u901a\u8fc7\u7f51\u5173\u670d\u52a1\u5668\u96c6\u7fa4\u4e0e\u903b\u8f91\u670d\u52a1\u5668\u96c6\u7fa4\u901a\u4fe1\uff0c\u5229\u7528\u6ce8\u518c\u4e2d\u5fc3\u8fdb\u884c\u670d\u52a1\u53d1\u73b0\u3002\u6838\u5fc3\u529f\u80fd\u5b9e\u73b0\u57fa\u4e8eNetty\u7684\u9ad8\u6027\u80fd\u7f51\u7edc\u5c42\uff0c\u652f\u6301\u591a\u534f\u8bae\u89e3\u6790\u548c\u4f1a\u8bdd\u7ba1\u7406\uff0c\u4f7f\u7528Protobuf\u5904\u7406\u6e38\u620f\u534f\u8bae\uff0c\u5e76\u901a\u8fc7\u670d\u52a1\u6ce8\u518c\u4e0e\u53d1\u73b0\u52a8\u6001\u7ba1\u7406\u540e\u7aef\u670d\u52a1\u3002\u5b89\u5168\u9632\u62a4\u63aa\u65bd\u5305\u62ecIP\u9650\u6d41\u3001\u534f\u8bae\u6821\u9a8c\u548c\u6570\u636e\u52a0\u5bc6\uff0c\u6027\u80fd\u4f18\u5316\u5219\u6d89\u53ca\u8fde\u63a5\u6c60\u3001\u5f02\u6b65\u5904\u7406\u548c\u6570\u636e\u538b\u7f29\u3002\u90e8\u7f72\u67b6\u6784\u5305\u62ec\u5ba2\u6237\u7aef\u3001CDN\/WAF\u3001\u8d1f\u8f7d\u5747\u8861\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/37117.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-13T23:26:13+00:00\" \/>\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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/37117.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/37117.html\",\"name\":\"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-13T23:26:13+00:00\",\"dateModified\":\"2025-05-13T23:26:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/37117.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/37117.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/37117.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb\"}]},{\"@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":"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb - \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\/37117.html","og_locale":"zh_CN","og_type":"article","og_title":"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e23\u6b21\uff0c\u6536\u85cf8\u6b21\u3002Java\u6e38\u620f\u670d\u52a1\u5668\u67b6\u6784\u4e2d\u7684\u7f51\u5173\u670d\u52a1\u5668\u662f\u8fde\u63a5\u5ba2\u6237\u7aef\u4e0e\u540e\u7aef\u670d\u52a1\u7684\u5173\u952e\u7ec4\u4ef6\uff0c\u4e3b\u8981\u804c\u8d23\u5305\u62ec\u7f51\u7edc\u901a\u4fe1\u7ba1\u7406\u3001\u534f\u8bae\u89e3\u6790\u4e0e\u5e8f\u5217\u5316\u3001\u8bf7\u6c42\u8def\u7531\u3001\u8d1f\u8f7d\u5747\u8861\u548c\u5b89\u5168\u9632\u62a4\u3002\u5178\u578b\u67b6\u6784\u91c7\u7528\u5206\u5c42\u8bbe\u8ba1\uff0c\u5ba2\u6237\u7aef\u901a\u8fc7\u7f51\u5173\u670d\u52a1\u5668\u96c6\u7fa4\u4e0e\u903b\u8f91\u670d\u52a1\u5668\u96c6\u7fa4\u901a\u4fe1\uff0c\u5229\u7528\u6ce8\u518c\u4e2d\u5fc3\u8fdb\u884c\u670d\u52a1\u53d1\u73b0\u3002\u6838\u5fc3\u529f\u80fd\u5b9e\u73b0\u57fa\u4e8eNetty\u7684\u9ad8\u6027\u80fd\u7f51\u7edc\u5c42\uff0c\u652f\u6301\u591a\u534f\u8bae\u89e3\u6790\u548c\u4f1a\u8bdd\u7ba1\u7406\uff0c\u4f7f\u7528Protobuf\u5904\u7406\u6e38\u620f\u534f\u8bae\uff0c\u5e76\u901a\u8fc7\u670d\u52a1\u6ce8\u518c\u4e0e\u53d1\u73b0\u52a8\u6001\u7ba1\u7406\u540e\u7aef\u670d\u52a1\u3002\u5b89\u5168\u9632\u62a4\u63aa\u65bd\u5305\u62ecIP\u9650\u6d41\u3001\u534f\u8bae\u6821\u9a8c\u548c\u6570\u636e\u52a0\u5bc6\uff0c\u6027\u80fd\u4f18\u5316\u5219\u6d89\u53ca\u8fde\u63a5\u6c60\u3001\u5f02\u6b65\u5904\u7406\u548c\u6570\u636e\u538b\u7f29\u3002\u90e8\u7f72\u67b6\u6784\u5305\u62ec\u5ba2\u6237\u7aef\u3001CDN\/WAF\u3001\u8d1f\u8f7d\u5747\u8861\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/37117.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-13T23:26:13+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/37117.html","url":"https:\/\/www.wsisp.com\/helps\/37117.html","name":"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-13T23:26:13+00:00","dateModified":"2025-05-13T23:26:13+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/37117.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/37117.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/37117.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Java\u6e38\u620f\u670d\u52a1\u5668\u5f00\u53d1\u6d41\u6c34\u8d26(6)\u7f51\u5173\u670d\u52a1\u5668\u7b80\u4ecb"}]},{"@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\/37117","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=37117"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/37117\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=37117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=37117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=37117"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=37117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}