<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          simple-rpc基于 netty 的 RPC 框架

          聯(lián)合創(chuàng)作 · 2023-09-23 12:43

          simple-rpc 是一款基于 netty 的 RPC 框架,現(xiàn)有功能

          • 基本的客戶端、服務(wù)端交互

          • 提供代理實(shí)現(xiàn)接口

          • spring 集成, xml配置和Java Config配置方式

          • 服務(wù)發(fā)布訂閱 DONE

          • 斷線重連 DONE

          RoadMap

          • 服務(wù)心跳檢測(cè)

          • 連接池

          • 服務(wù)注冊(cè)發(fā)布功能

          • 服務(wù)管理、監(jiān)控

          • 服務(wù)調(diào)用日志鏈路跟蹤

          • 集成swagger功能,提供文檔、測(cè)試、客戶端生成

          使用示例

          // 服務(wù)接口
          public interface IHello {
          `
              String say(String hello);
          
              int sum(int a, int b);
              int sum(Integer a, Integer b);
          }
          // 服務(wù)實(shí)現(xiàn)
          public class HelloImpl implements IHello {
              public String say(String hello) {
                  return "return " + hello;
              }
          
              public int sum(int a, int b) {
                  return a + b;
              }
          
              public int sum(Integer a, Integer b) {
                  return a + b * 3;
              }
          
          }
          
          // 客戶端代碼
          // beanJavaConfig方式
          @Bean
              public CountService countService() {
                  RpcClientWithLB rpcClientWithLB = new RpcClientWithLB("fyes-counter");
                  rpcClientWithLB.setZkConn("10.4.105.252:2181");
                  rpcClientWithLB.init();
                  CountService countService = rpcClientWithLB.newProxy(CountService.class);
                  return countService;
              }
          
          // 服務(wù)端發(fā)布
          // xml配置方式
          <bean class="com.github.liuzhengyang.simplerpc.ServerFactoryBean" init-method="start">
                  <property name="serviceInterface" value="com.test.liuzhengyang.CountService"/>
                  <property name="port" value="8888"/>
                  <property name="serviceName" value="fyes-counter"/>
                  <property name="serviceImpl" ref="countServiceImpl"/>
                  <property name="zkConn" value="127.0.0.1:2181"/>
          瀏覽 20
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  天天日天天撸 | 中国精品一区 | 欧美日韩国产操逼 | 91线上| 无码福利一区 |