Thrift是一个RPC软件框架,
解决各系统间大数据量的传输通信以及系统之间语言环境不同需要跨平台的特性.近期的项目中用到了Thrift,做了一个简单的demo.环境:
1.eclipse
2.Thrift-0.10.0
Demo:
新建两个maven项目,thriftServer和thriftClient.其中thriftServer是服务端,thriftClient是客户端
Pom文件
分别在thriftServer和thriftClient的pom文件中添加下面的引用
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>