Giter VIP home page Giter VIP logo

midware-ice-service's Introduction

midware-ice-service

ICE异步SERVER,并集成libgo携程库,实现中间件服务(示例,具体的服务逻辑需要DIY)

依赖:

  • ice
  • libgo
  • boost-1.61.0

安装约定:

依赖的CPP库统一安装在目录: /home/apps/cpplibs/下,如:

  • ice安装目录: /home/apps/cpplibs/Ice-3.6.4
  • boost-1.61.0安装目录: /home/apps/cpplibs/boost-1.61.0
  • libgo安装目录: /home/apps/cpplibs/libgo (master)

接口约定:

  interface Srv {
      ["amd"] idempotent bool Call(string rqstid, string method, string rqst, out string resp);
  };

  # amd: Asynchronous Method Dispatch(AMD),标明接口SERVER端使用异步ICE机制实现。
  # idempotent: 因为ICE是基于At-Most-Once Semantics。An idempotent operation is an operation that, if executed twice, has the same effect as if executed once. 即idempotent表示接口可重入,根据业务情况添加或去除。

  # 函数原型:
    bool Call(string rqstid, string method, string rqst, out string resp);
    参数:
      @rqstid: 可以唯一跟踪服务调用情况
      @method: 调用方法名,可以区分不同的操作
      @rqst:   请求参数,推荐使用json格式(示例使用json)
      @resp:   输出参数,返回结果,推荐使用json格式(后续引入聚合中间件要求符合一定格式)

运行:

  1. 参照'midware-ice-cluster'搭建基本的ICE集群(也可以是单机环境)
  2. 编译生成midware-ice-service和midware-ice-service-client 在根目录下执行: . ./setenv.sh cmake . make
  3. 与config下文件部署在同一目录
  4. sh ctrl.sh查看操作说明
    • 第一次部署需要: sh ctrl.sh add
    • application.xml存在更新时: sh ctrl.sh update
    • 启动服务: sh ctrl.sh start
    • 停止服务: sh ctrl.sh stop
    • 升级服务: sh ctrl.sh stop_disable ## 应为ICE框架当请求到来时会自动调起服务,所以必须先disable后,再更新binary程序;因为在程序运行时更新binary会失败,无法完成升级,所以需要stop and disable。
    • 升级完成: sh ctrl.sh start_enable ## 升级完后,通过start_enable启动服务
  5. 测试 ./midware-ice-service-client

欢迎交流 QQ群: 92799001

midware-ice-service's People

Contributors

fengliangwang avatar

Watchers

James Cloos avatar Zexuan Wu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.