美文网首页
springboot 整合hessian(client端)

springboot 整合hessian(client端)

作者: 不知不怪 | 来源:发表于2018-08-28 18:48 被阅读0次

    client端

    pom.xml 同server端

    application.properties

    server.port = 8081
    

    user.java 同server端

    userCondition.java 同server端

    IHelloService 同server端

    主程序(重点.....)

    package com;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.context.annotation.Bean;
    import org.springframework.remoting.caucho.HessianProxyFactoryBean;
    
    import com.example.IHelloService;
    
    /**
     * @功能描述 Hessian实例之客户端
     * @author www.gaozz.club
     * @date 2018-08-26
     */
    @SpringBootApplication
    public class HessianClient {
        @Bean
        public HessianProxyFactoryBean helloClient() {
            HessianProxyFactoryBean factory = new HessianProxyFactoryBean();
            factory.setServiceUrl("http://localhost:8080/HelloService");
            factory.setServiceInterface(IHelloService.class);
            return factory;
        }
    
        public static void main(String[] args) {
            SpringApplication.run(HessianClient.class, args);
        }
    }
    
    
    QQ图片20180828184600.png QQ图片20180828184607.png QQ图片20180828184755.png QQ图片20180828184803.png

    代码生成器源码

    代码生成器演示

    spring boot 2.x 实例源码

    相关文章

      网友评论

          本文标题:springboot 整合hessian(client端)

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