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 ...
随机推荐
- IDEA+SpringBoot+Mybatis+maven分布式项目框架的搭建
参考文章:https://blog.csdn.net/qq_34410726/article/details/98214992 一.maven分布式工程的基本架构 demo #父工程模块,主要用来定 ...
- Linux线上与本地的httpd搭建【制作本地yum源】
当前时间 2019-10-24-10:53:12 制作本地yum源 我用的VMware Workstation 系统环境: CentOS 7.5 首先我们先要挂载系统镜像 [root@laopa ~] ...
- 在SQL Server数据库中执行存储过程很快,在c#中调用很慢的问题
记录工作中遇到的问题,分享出来: 原博客地址:https://blog.csdn.net/weixin_40782680/article/details/85038281 今天遇到一个比较郁闷的问题, ...
- python selenium框架的Xpath定位元素
我们工作中经常用到的定位方式有八大种:id name class_name tag_name link_text partial_link_text xpath css_selector 本篇内容主要 ...
- Dart Learn Notes 02
Functions Dart是一门面向对象的语言,所以即便是方法也是一个对象,它的类型是Function. 这就意味着方法可以指向变量,也可以作为方法中的参数供其他方法使用.甚至可以让 一个类作为一个 ...
- JAVA——汉诺塔
大家还记得某年春晚小品那个把大象放冰箱需要几步吗? 今天,我准备写的是汉诺塔,有三个魔法石柱,分别:诚实.勇敢.正直.其中有一个石柱上从大到小,从地向上依次排放着四个魔法圆环,需要将那四个魔法圆环分别 ...
- centos7环境搭建一台mysql服务器启动多个端口
在一台服务器上启动多个mysql实例,分别用不同的端口号,因centos7版本安装mysql5.7后不存在mysqld_multi .mysqld_safe等命令,做踩坑总结 Mysql多实例实现的3 ...
- 请求头里显示Provisional headers are shown的问题
1.问题描述: 在工作中遇到了一个坑.登录一个系统的时候,退出登录不好使了,前端确实调用了logout的接口(退出接口),但是这个接口的请求头显示Provisional headers are sho ...
- Docker 自建私有Registry 私有仓库
目录 说明 介绍 原理 搭建 查看配置文件 启动 上传和下载镜像测试 测试上传镜像 测试下载镜像 说明 记录搭建 docker 私有仓库步骤 介绍 docker镜像可以托管到dockerhub中,跟代 ...
- Docker部署Mysql集群
单节点数据库的弊病 大型互联网程序用户群体庞大,所以架构必须要特殊设计 单节点的数据库无法满足性能上的要求 单节点的数据库没有冗余设计,无法满足高可用 单节点MySQL的性能瓶领颈 2016年春节微信 ...