An open API service indexing awesome lists of open source software.

https://github.com/linux-china/hessian-spring-boot-starter

Spring Boot Start for Hessian
https://github.com/linux-china/hessian-spring-boot-starter

Last synced: 9 months ago
JSON representation

Spring Boot Start for Hessian

Awesome Lists containing this project

README

          

hessian-spring-boot-start
=========================
Spring boot starter hessian。

### 如何使用

* 在Spring Boot项目的pom.xml中添加以下依赖:


com.mvnsearch.spring.boot
hessian-boot-starter
1.0.0-SNAPSHOT

* 创建对应的hessian service bean, 这里请注意bean的名称。 代码如下:

@Component(value = "userService")
@HessianService(serviceInterface = UserService.class)
public class UserServiceImpl implements UserService {
public String findNick(Integer id) {
return "nick:" + id;
}
}

* hessian服务最终会以"/userService" 发布出去,客户端代码调用如下,当然你可以可以创建一个Bean。

String url = "http://localhost:8080/userService";
HessianProxyFactory factory = new HessianProxyFactory();
UserService basic = (UserService) factory.create(UserService.class, url);

### 参考文档

* Hessian: http://hessian.caucho.com/