Spring Integration - WS Outbound Gateway
1.通过MessageSender客户化http连接参数
AbstractHttpWebServiceMessageSender有若干实现子类:
- CommonsHttpMessageSender(deprecated)
- HttpComponentsMessageSender
- HttpUrlConnectionMessageSender
2.CommonsHttpMessageSender
2.1 CommonsHttpMessageSender 需要依赖于Apache httpclient包
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>{version}</version>
</dependency>
2.2 示例源于spring integration sample master
<chain input-channel="fahrenheitChannel" output-channel="celsiusChannel">
<ws:header-enricher>
<ws:soap-action value="http://www.w3schools.com/webservices/CelsiusToFahrenheit" />
</ws:header-enricher>
<ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx" message-sender="httpSender"/>
</chain>
<beans:bean id="httpSender" class="org.springframework.ws.transport.http.CommonsHttpMessageSender">
<beans:constructor-arg name="httpClient">
<beans:bean class="org.apache.commons.httpclient.HttpClient">
<beans:property name="httpConnectionManager" ref="httpConnectionManager" />
</beans:bean>
</beans:constructor-arg>
</beans:bean>
<beans:bean id="httpConnectionManager" class="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager">
<beans:property name="params">
<beans:bean class="org.apache.commons.httpclient.params.HttpConnectionManagerParams">
<beans:property name="soTimeout" value="5000" />
<!-- <beans:property name="maxTotalConnections" value="100" />
<beans:property name="defaultMaxConnectionsPerHost" value="100" /> -->
</beans:bean>
</beans:property>
</beans:bean>
3. HttpComponentsMessageSender
3.1 HttpComponentsMessageSender 需要依赖于Apache http components包
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.3</version>
</dependency>
3.2 配置相对容易
<ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx" message-sender="httpComponentsSender" />
<beans:bean id="httpComponentsSender" class="org.springframework.ws.transport.http.HttpComponentsMessageSender">
<beans:property name="connectionTimeout" value="12" />
<beans:property name="readTimeout" value="12" />
</beans:bean>
That's it!
Spring Integration - WS Outbound Gateway的更多相关文章
- [转] Spring Integration 系统集成
[From] http://blog.csdn.net/w_x_z_/article/details/53316618 pring Ingegration 提供了基于Spring的EIP(Enterp ...
- Spring Integration - 自动轮询发送手机短信
Spring Integration 配置 <?xml version="1.0" encoding="UTF-8"?> <beans xml ...
- spring Integration服务总线
最新项目中使用数据交换平台,主要通过交换平台抓取HIS数据库医生医嘱检查检验等数据以及FTP上的txt文件,html等病程文件,生成XML文件,之后通过业务系统按业务规则对数据进行处理,再将其存入数据 ...
- Spring Integration实现分布式锁
学习本篇之前,可以先看下文章 什么是分布式锁,了解下基本概念. 之前都是手写一个分布式锁,其实Spring早就提供了分布式锁的实现.早期,分布式锁的相关代码存在于Spring Cloud的子项目Spr ...
- Spring Integration概述
1. Spring Integration概述 1.1 背景 Spring框架的一个重要主题是控制反转.从广义上来说,Spring处理其上下文中管理的组件的职责.只要组件减轻了职责,它们同 ...
- ref:Spring Integration Zip 不安全解压(CVE-2018-1261)漏洞分析
ref:https://mp.weixin.qq.com/s/SJPXdZWNKypvWmL-roIE0Q 0x00 漏洞概览 漏洞名称:Spring Integration Zip不安全解压 漏洞编 ...
- 0.9.0.RELEASE版本的spring cloud alibaba sentinel+gateway网关实例
sentinel除了让服务提供方.消费方用之外,网关也能用它来限流.我们基于上次整的网关(参见0.9.0.RELEASE版本的spring cloud alibaba nacos+gateway网关实 ...
- Spring Cloud 系列之 Gateway 服务网关(二)
本篇文章为系列文章,未读第一集的同学请猛戳这里:Spring Cloud 系列之 Gateway 服务网关(一) 本篇文章讲解 Gateway 网关的多种路由规则.动态路由规则(配合服务发现的路由规则 ...
- Spring Cloud 系列之 Gateway 服务网关(三)
本篇文章为系列文章,未读第一集的同学请猛戳这里: Spring Cloud 系列之 Gateway 服务网关(一) Spring Cloud 系列之 Gateway 服务网关(二) 本篇文章讲解 Ga ...
随机推荐
- MySQL数据库的主从同步
什么要进行数据库的主从同步? 防止单点故障造成的数据丢失 主从复制的原理 MySQL从数据库开启I/O线程,向主服务器发送请求数据同步(获取二进制日志) MySQL数据库开启I/O线程回应从数据库 从 ...
- C++控制台闪回;编译器警告C4305,C4244
这是我以前解决问题时,收集在印象笔记里的内容,为了以后整理方便,把它转移至这里.以下内容,均来自微软官方网站相关. 问题:C++控制台闪回 解决办法: 1,在程序结尾添加system( ...
- ubuntu 16.04上源码编译glog和gflags 编写glog-config.cmake和gflags-config.cmake | compile glog and glags on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/977f5125/,欢迎阅读! compile glog and glags on ubuntu 16.04 Series comp ...
- template screen
从全局搜索主机可看到此screen
- C语言与汇编语言混合编程实验
混合编程方法: 模块链接法 汇编指令嵌入法 1: 模块链接法则 模块链接法是指分别用汇编语言和C语言实现独立的模块(或子程序),再用链接程序把各模块生成的obj文件连接成一个可执行程序. 1:C语言调 ...
- linuxLVM之LV扩大和缩小容量(非xfs文件系统)
LVM的基础请见:https://www.cnblogs.com/wxxjianchi/p/9698089.html 一.放大LV的容量.放大容量是由内而外来操作的. 1.设置新的lvm分区:用fdi ...
- WPF之路由事件的理解
博客园上讲解路由事件的文章很多,在此转其中之一供学习参考: https://www.cnblogs.com/zhili/p/WPFRouteEvent.html 网上流传的文章中都对冒泡进行了说明,但 ...
- 机器学习回顾篇(11):支持向量机(SVM)
.caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px so ...
- 【Android - 自定义View】之View的事件分发机制
参考资料: View事件分发:http://blog.csdn.net/pi9nc/article/details/9281829 ViewGroup事件分发:http://blog.csdn.net ...
- CentOS 7 Cobbler 配置 YUM仓库
通过Cobbler配置内网YUM仓库 在上一篇Cobbler 安装中,配置好了Cobbler 下面来通过Cobbler来配置内网的YUM仓库 这里可以同步所有版本的yum源,增加内网的yum安装下载速 ...