默认情况下,客户端的HttpInvokerProxy使用J2SE的HTTP
Client来建立连接,即
org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor,
可以通过设置httpInvokerRequestExecutor属性来改变默认配置,spring提供了另外一种
HttpClient,org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor。
修改配置如下:
<bean id="httpService"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl">
<value>http://vm.netqin.com:4080/ucs/service/httpService</value>
</property>
<property name="serviceInterface" value="com.netqin.baike.service.UcService">
</property>
<property name="httpInvokerRequestExecutor">
<bean
class="org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor" />
</property>
</bean>
需要在项目中引入两个jar包:
commons-codec-x.x.jar
commons-httpclient-x.x.x.jar
CommonsHttpInvokerRequestExecutor具有HTTP connection
pooling,不过通过使用jmeter进行压力测试发现,SimpleHttpInvokerRequestExecutor性能高于
CommonsHttpInvokerRequestExecutor
分享到:
相关推荐
公司内部讲义,比较了SOA,RMI和Spring HttpInvoker。并介绍了Spring HttpInvoker的基本使用方法。
Spring HttpInvoker,是一套基于Maven+Spring+SpringMVC+MyBatis框架,还包含了Invoker的客户端及服务器端的demo实例
Spring httpInvoker使用标准java序列化机制,通过Http暴露业务服务。如果你的参数和返回值是比较复杂的,通过httpInvoker有巨大的优势。 1. 远程访问流程 1) 服务端定义服务接口 2) 服务端实现服务接口 3) 暴露服务...
org.springframework.remoting.httpinvoker最基本的实现例子,这是3个eclipse的JavaEE工程,全部导入即可,能运行。 初学可以轻松了解Spring HttpInvoker 的结构和使用。
NULL 博文链接:https://tou3921.iteye.com/blog/1729111
spring+httpInvoker 实例,含服务端和客户端代码,myEclipse工程,直接导入就可以测试,适合初学者. 提供 普通参数返回值和自定义对象返回值,两个方式.
Spring HTTP Invoker是spring框架中的一个远程调用模型,执行基于HTTP的远程调用,也就是说,可以通过防火墙,并使用java的序列化机制在网络间传递对象。客户端可以很轻松的像调用本地对象一样调用远程服务器上的...
NULL 博文链接:https://lggege.iteye.com/blog/369151
springboot-httpinvoker-demo.zip
和Hessian的轻量级传输协议不同的是,Spring HttpInvoker使用Java序列化来序列化参数和返回值,然后基于HTTP协议传输经序列化后的对象。当参数或返回值是复杂类型,并且不能通过Hessian的序列化机制序列化时,...
基于Spring的HttpInvoker实现改写服务器端调用: HttpInvoker.invoker 方法,设置InvokerProcess处理客户端调用: ProxyFactory.proxy 方法,生成接口的代理对象,直接调用方法客户端和服务器端的接口和实体类要...
http invoker 在开发完http接口后可以做http post测试
NULL 博文链接:https://lggege.iteye.com/blog/404124
Hessian 、 HttpInvoker 、 XFire 、 Axis
里面有两个工程,一个模拟服务端,一个模拟客户端。演示了最近本的httpinvoker的使用
Hessian和Burlap都是基于HTTP的,他们... Spring开发团队意识到RMI服务和基于HTTP的服务之前的空白,Spring的HttpInvoker应运而生。 Spring的HttpInvoker,它基于HTTP之上提供RPC,同时又使用了Java的对象序列化机
接口测试工具,不太好用,不建议使用,自己传着玩儿的
模拟提交GET/POST,鞥呢返回详细头,cookies
包含Jmail例子,AOP面向切面编程的日志处理例子,HttpInvoker的例子,RMI远程调用的例子,定时任务的例子,自己没事写的,简单易懂
可以方便的实现http消息调试,比控制台F12开发者工具中显示的更加详细透彻