美文网首页
turbo-rpc.spring-xml

turbo-rpc.spring-xml

作者: 贾老师和他的朋友们 | 来源:发表于2019-11-20 14:10 被阅读0次
Turborpc

针对非Boot环境使用hessian远程调用

下面是一般spring项目的处理方式

1、配置对应的service实现类

<beans:bean id="wfEventChange" class="com.eon.dms.core.api.oa.rpc.WfEventChangeService" />

2、暴露远程服务

<beans:bean name="/hessian" class="org.springframework.remoting.caucho.HessianServiceExporter">
        <beans:property name="service" ref="wfEventChange" />
        <beans:property name="serviceInterface" value="com.eon.dms.core.api.oa.rpc.IwfEventChange" />
    </beans:bean >

3、在服务端实现接口 例如OaApiServiceItf

  编写service,实现这个接口

4、客户端
需要服务端的接口,最好做一个公共module来处理
客户端调用服务端

     HessianProxyFactory factory = new HessianProxyFactory();
     IwfEventChange basic = (IwfEventChange)factory.create(IwfEventChange.class, url); 

相关文章

  • turbo-rpc.spring-xml

    针对非Boot环境使用hessian远程调用 下面是一般spring项目的处理方式 1、配置对应的service实...

网友评论

      本文标题:turbo-rpc.spring-xml

      本文链接:https://www.haomeiwen.com/subject/kjonictx.html