GateWay:网关
channel:数据传输的通道
adapter:数据连接通道的数据适配器
spliter:对通道里面的数据进行分割
router:对通道进行路由
transforme:对消息进行格式化转化
service-activator:服务激活器(在通道上边挂接业务处理组件)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-event="http://www.springframework.org/schema/integration/event"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:int-groovy="http://www.springframework.org/schema/integration/groovy"
xmlns:int-http="http://www.springframework.org/schema/integration/http"
xmlns:int-httpinvoker="http://www.springframework.org/schema/integration/httpinvoker"
xmlns:int-ip="http://www.springframework.org/schema/integration/ip"
xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.0.xsd
http://www.springframework.org/schema/integration/groovy http://www.springframework.org/schema/integration/groovy/spring-integration-groovy-2.0.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc-2.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/event http://www.springframework.org/schema/integration/event/spring-integration-event-2.0.xsd
http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http-2.0.xsd
http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-2.0.xsd
http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip-2.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/integration/httpinvoker http://www.springframework.org/schema/integration/httpinvoker/spring-integration-httpinvoker-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 获取目录下的的包中的所有类 -->
<context:component-scan base-package="com.tjbt.hiscase.tools" />
<int:gateway id="IGetPatientInfo" service-interface="com.tjbt.hiscase.service.IGetPatientInfo"
default-request-channel="channel1">
</int:gateway>
<int:gateway id="IGetClinicInfo" service-interface="com.tjbt.hiscase.service.IGetClinicInfo"
default-request-channel="Clinicchannel1">
</int:gateway> <int:poller id="globalPoller" default="true"
max-messages-per-poll="1" cron="0-59 * * * * ?" /> <!-- 建立一个channel 即连接数据库获取到的记录的channel -->
<int:channel id="channel1">
<!-- <int:interceptors> -->
<!-- <int:wire-tap channel="logger" /> -->
<!-- </int:interceptors> -->
</int:channel> <!-- 分割一个数组 分割成一条条的记录 -->
<int:splitter id="testSplitter" input-channel="channel1"
output-channel="channel2" /> <int:splitter id="testSplitter1" input-channel="Clinicchannel1"
output-channel="Clinicchannel2" /> <int:channel id="channel2">
<int:queue capacity="10" />
</int:channel> <int:channel id="Clinicchannel2">
<int:queue capacity="10" />
</int:channel> <int:header-enricher input-channel="channel2"
output-channel="channel3">
<int:header name="exportType" value="患者住院信息" />
<int:header name="patientId" expression="payload.patientId" />
<int:header name="visitId" expression="payload.visitId" />
<int:header name="catalogDate" expression="payload.catalogDate" />
<int:header name="exportSize" expression="1" />
<int:header name="exportManner" value="manual"></int:header>
</int:header-enricher> <int:header-enricher input-channel="Clinicchannel2"
output-channel="Clinicchannel3">
<int:header name="exportType" expression="'门诊信息'+payload.visitNo" />
<int:header name="visitDate" expression="payload.visitDate" />
<int:header name="visitNo" expression="payload.visitNo" />
<int:header name="exportManner" value="auto"></int:header>
</int:header-enricher> <int:channel id="channel3">
<int:queue capacity="10" />
</int:channel> <int:channel id="Clinicchannel3">
<int:queue capacity="10" />
</int:channel> <int:filter input-channel="channel3" output-channel="channel3x"
ref="mapper" /> <int:splitter input-channel="channel3x" output-channel="channel4"
ref="DataBaseService" method="dispatch" /> <int:splitter input-channel="Clinicchannel3"
output-channel="channel4" ref="ClinicService" method="dispatch" /> <int:channel id="channel4">
<int:queue capacity="1" />
</int:channel> <int:transformer ref="mapper" input-channel="channel4"
output-channel="channel5" /> <int:publish-subscribe-channel id="channel5" > </int:publish-subscribe-channel> <!-- 把转换好的xml输出到一个目录下 -->
<!-- <int-file:outbound-channel-adapter
channel="channel5" id="filesOut" directory="D:\数据交换平台导出目录" charset="UTF-8"
filename-generator-expression="headers.get('patientId') == null ? headers.exportType + '-' + @mapper.getFileCreatedTime() +'.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + @mapper.getFileCreatedTime() + '.xml'" />--> <!-- 把转换好的xml输出到一个目录下 -->
<int-file:outbound-channel-adapter
channel="channel5" id="filesOutbackup" directory="D:\数据交换平台导入目录"
charset="UTF-8"
filename-generator-expression="headers.get('patientId') == null ? headers.exportType + '-' + @mapper.getFileCreatedTime() +'.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + @mapper.getFileCreatedTime() + '.xml'" /> <int:chain input-channel="channel5" output-channel="channelbl6">
<int:filter expression="headers.get('patientId') != null" />
<int:service-activator ref="AnalyseXMLService"
method="callJar">
<int:poller receive-timeout="5000" fixed-rate="1000" />
</int:service-activator>
</int:chain> <int:channel id="channelbl6">
<int:queue capacity="100" />
</int:channel> <!-- <int:chain input-channel="channelbl6" output-channel="logger">
<int:service-activator ref="blexportFile"
method="saveFile">
<int:poller receive-timeout="5000" fixed-rate="1000" />
</int:service-activator>
</int:chain> <bean id="blexportFile" class="com.tjbt.hiscase.service.ExportFile"
autowire="byType">
<property name="directory" value="D:\数据交换平台导入目录\bl"></property>
<property name="charset" value="UTF-8"></property>
<property name="filename_generator_expression"
value="headers.get('patientId') == null ? headers.exportType + '-' + '.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + '.xml'" />
</bean> --> <!--<int-stream:stdout-channel-adapter
channel="logger" append-newline="true" />--> <int:wire-tap pattern="*" order="1" channel="logger" /> <int:channel id="logger">
<int:queue capacity="1000" />
</int:channel> <int:channel id="errorChannel">
<int:queue capacity="500" />
</int:channel>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-event="http://www.springframework.org/schema/integration/event"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:int-groovy="http://www.springframework.org/schema/integration/groovy"
xmlns:int-http="http://www.springframework.org/schema/integration/http"
xmlns:int-httpinvoker="http://www.springframework.org/schema/integration/httpinvoker"
xmlns:int-ip="http://www.springframework.org/schema/integration/ip"
xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.0.xsd
http://www.springframework.org/schema/integration/groovy http://www.springframework.org/schema/integration/groovy/spring-integration-groovy-2.0.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc-2.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/event http://www.springframework.org/schema/integration/event/spring-integration-event-2.0.xsd
http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http-2.0.xsd
http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-2.0.xsd
http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip-2.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/integration/httpinvoker http://www.springframework.org/schema/integration/httpinvoker/spring-integration-httpinvoker-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 获取目录下的的包中的所有类 -->
<context:component-scan base-package="com.tjbt.hiscase.tools" />
<int:gateway id="IGetPatientInfo" service-interface="com.tjbt.hiscase.service.IGetPatientInfo"
default-request-channel="channel1">
</int:gateway>
<int:gateway id="IGetClinicInfo" service-interface="com.tjbt.hiscase.service.IGetClinicInfo"
default-request-channel="Clinicchannel1">
</int:gateway> <int:poller id="globalPoller" default="true"
max-messages-per-poll="1" cron="0-59 * * * * ?" /> <!-- 建立一个channel 即连接数据库获取到的记录的channel -->
<int:channel id="channel1">
<!-- <int:interceptors> -->
<!-- <int:wire-tap channel="logger" /> -->
<!-- </int:interceptors> -->
</int:channel> <!-- 分割一个数组 分割成一条条的记录 -->
<int:splitter id="testSplitter" input-channel="channel1"
output-channel="channel2" /> <int:splitter id="testSplitter1" input-channel="Clinicchannel1"
output-channel="Clinicchannel2" /> <int:channel id="channel2">
<int:queue capacity="10" />
</int:channel> <int:channel id="Clinicchannel2">
<int:queue capacity="10" />
</int:channel> <int:header-enricher input-channel="channel2"
output-channel="channel3">
<int:header name="exportType" value="患者住院信息" />
<int:header name="patientId" expression="payload.patientId" />
<int:header name="visitId" expression="payload.visitId" />
<int:header name="catalogDate" expression="payload.catalogDate" />
<int:header name="exportSize" expression="1" />
<int:header name="exportManner" value="manual"></int:header>
</int:header-enricher> <int:header-enricher input-channel="Clinicchannel2"
output-channel="Clinicchannel3">
<int:header name="exportType" expression="'门诊信息'+payload.visitNo" />
<int:header name="visitDate" expression="payload.visitDate" />
<int:header name="visitNo" expression="payload.visitNo" />
<int:header name="exportManner" value="auto"></int:header>
</int:header-enricher> <int:channel id="channel3">
<int:queue capacity="10" />
</int:channel> <int:channel id="Clinicchannel3">
<int:queue capacity="10" />
</int:channel> <int:filter input-channel="channel3" output-channel="channel3x"
ref="mapper" /> <int:splitter input-channel="channel3x" output-channel="channel4"
ref="DataBaseService" method="dispatch" /> <int:splitter input-channel="Clinicchannel3"
output-channel="channel4" ref="ClinicService" method="dispatch" /> <int:channel id="channel4">
<int:queue capacity="10" />
</int:channel> <int:transformer ref="mapper" input-channel="channel4"
output-channel="channel5" /> <int:publish-subscribe-channel id="channel5" /> <!-- 把转换好的xml输出到一个目录下 -->
<!-- <int-file:outbound-channel-adapter
channel="channel5" id="filesOut" directory="D:\数据交换平台导出目录" charset="UTF-8"
filename-generator-expression="headers.get('patientId') == null ? headers.exportType + '-' + @mapper.getFileCreatedTime() +'.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + @mapper.getFileCreatedTime() + '.xml'" /> -->
<!-- 把转换好的xml输出到一个目录下 -->
<int-file:outbound-channel-adapter
channel="channel5" id="filesOutbackup" directory="D:\数据交换平台导入目录"
charset="UTF-8"
filename-generator-expression="headers.get('patientId') == null ? headers.exportType + '-' + @mapper.getFileCreatedTime() +'.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + @mapper.getFileCreatedTime() + '.xml'" /> <int:chain input-channel="channel5" output-channel="channelbl6">
<int:filter expression="headers.get('patientId') != null" />
<int:service-activator ref="AnalyseXMLService"
method="callJar">
<int:poller receive-timeout="5000" fixed-rate="1000" />
</int:service-activator>
</int:chain> <int:channel id="channelbl6">
<int:queue capacity="100" />
</int:channel> <int:chain input-channel="channelbl6" output-channel="logger">
<int:service-activator ref="blexportFile"
method="saveFile">
<int:poller receive-timeout="5000" fixed-rate="1000" />
</int:service-activator>
</int:chain> <bean id="blexportFile" class="com.tjbt.hiscase.service.ExportFile"
autowire="byType">
<property name="directory" value="D:\数据交换平台导入目录\bl"></property>
<property name="charset" value="UTF-8"></property>
<property name="filename_generator_expression"
value="headers.get('patientId') == null ? headers.exportType + '-' + '.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + '.xml'" />
</bean> <!-- <int-stream:stdout-channel-adapter
channel="logger" append-newline="true" />
-->
<int:wire-tap pattern="*" order="1" channel="logger" /> <int:channel id="logger">
<int:queue capacity="1000" />
</int:channel> <int:channel id="errorChannel">
<int:queue capacity="500" />
</int:channel> <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" >
<property name="brokerURL" value="tcp://localhost:61616"></property>
</bean> <bean id="destination"
class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg index="0" value="testmq"></constructor-arg>
</bean> <bean id="jmsTemplate"
class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory"></property>
<property name="defaultDestination" ref="destination"></property>
<!--<property name="messageConverter" ref="innerMessageConverter"></property> -->
</bean> <bean id="MessageGateWay" class="com.tjbt.hiscase.mqUtil.MessageGateWay">
<property name="jsmt" ref="jmsTemplate" ></property>
</bean>
<bean id="messageListener" class="com.tjbt.hiscase.mqUtil.MessageMDB">
<property name="ms" ref="MessageService"></property>
</bean> <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" lazy-init="false">
<property name="connectionFactory" ref="connectionFactory"></property>
<property name="destination" ref="destination"></property>
<property name="messageListener" ref="messageListener"></property>
<property name="concurrentConsumers" value="2"></property>
<!--0:CACHE_NONE,1:CACHE_CONNECTION,2:CACHE_SESSION,3:CACHE_CONSUMER,4:CACHE_AUTO-->
<property name="cacheLevel" value="0"/>
</bean> <bean id="MessageService" class="com.tjbt.hiscase.service.MessageService"></bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-event="http://www.springframework.org/schema/integration/event"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:int-groovy="http://www.springframework.org/schema/integration/groovy"
xmlns:int-http="http://www.springframework.org/schema/integration/http"
xmlns:int-httpinvoker="http://www.springframework.org/schema/integration/httpinvoker"
xmlns:int-ip="http://www.springframework.org/schema/integration/ip"
xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.0.xsd
http://www.springframework.org/schema/integration/groovy http://www.springframework.org/schema/integration/groovy/spring-integration-groovy-2.0.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc-2.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/event http://www.springframework.org/schema/integration/event/spring-integration-event-2.0.xsd
http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http-2.0.xsd
http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-2.0.xsd
http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip-2.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/integration/httpinvoker http://www.springframework.org/schema/integration/httpinvoker/spring-integration-httpinvoker-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 获取目录下的的包中的所有类 -->
<context:component-scan base-package="com.tjbt.hiscase.tools" />
<int:gateway id="IGetPatientInfo" service-interface="com.tjbt.hiscase.service.IGetPatientInfo"
default-request-channel="channel1">
</int:gateway>
<int:gateway id="IGetClinicInfo" service-interface="com.tjbt.hiscase.service.IGetClinicInfo"
default-request-channel="Clinicchannel1">
</int:gateway> <int:poller id="globalPoller" default="true"
max-messages-per-poll="1" cron="0-59 * * * * ?" /> <int:inbound-channel-adapter ref="DataBaseService"
method="inbound" channel="channel1" auto-startup="${HisCaseIsExport}">
<int:poller cron="${HisCaseInterval}" />
<int:header name="exportType" value="患者住院信息" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter ref="ClinicService"
method="getInfo" channel="Clinicchannel1" auto-startup="${ClinicIsExport}">
<int:poller cron="${ClinicInterval}" />
<int:header name="exportType" value="门诊信息" />
</int:inbound-channel-adapter>
<!-- 全表导出配置 -->
<int:inbound-channel-adapter id="exprotCountry"
ref="DataBaseService" method="exprotCountry" channel="channel4"
auto-startup="${CountryTypeIsExport}">
<int:poller cron="${CountryTypeInterval}" />
<int:header name="exportType" value="国家字典" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotArea"
ref="DataBaseService" method="exprotArea" channel="channel4"
auto-startup="${AreaIsExport}">
<int:poller cron="${AreaInterval}" />
<int:header name="exportType" value="行政区字典" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotDept"
ref="DataBaseService" method="exprotDept" channel="channel4"
auto-startup="${DeptIsExport}">
<int:poller cron="${DeptInterval}" />
<int:header name="exportType" value="科室表" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotUsers"
ref="DataBaseService" method="exprotUsers" channel="channel4"
auto-startup="${UsersIsExport}">
<int:poller cron="${UsersInterval}" />
<int:header name="exportType" value="用户记录" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotDiagnosis"
ref="DataBaseService" method="exprotDiagnosis" channel="channel4"
auto-startup="${DiagnosisIsExport}">
<int:poller cron="${DiagnosisInterval}" />
<int:header name="exportType" value="诊断字典" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotStaff"
ref="DataBaseService" method="exprotStaff" channel="channel4"
auto-startup="${StaffIsExport}">
<int:poller cron="${StaffInterval}" />
<int:header name="exportType" value="员工信息" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotDrugName"
ref="DataBaseService" method="exprotDrugName" channel="channel4"
auto-startup="${DrugNameIsExport}">
<int:poller cron="${DrugNameInterval}" />
<int:header name="exportType" value="药品名称字典" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotLabReportItem"
ref="DataBaseService" method="exprotLabReportItem" channel="channel4"
auto-startup="${LabReportItemIsExport}">
<int:poller cron="${LabReportItemInterval}" />
<int:header name="exportType" value="项目报告字典" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exprotOrderClass"
ref="DataBaseService" method="exprotOrderClass" channel="channel4"
auto-startup="${OrderClassIsExport}">
<int:poller cron="${OrderClassInterval}" />
<int:header name="exportType" value="医嘱类别字典" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exportDeptVsWard"
ref="DataBaseService" method="exportDeptVsWard" channel="channel4"
auto-startup="${DeptWardIsExport}">
<int:poller cron="${DeptWardInterval}" />
<int:header name="exportType" value="临床科室与病房(区)对照" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exportDiagCorrDict"
ref="DataBaseService" method="exportDiagCorrDict" channel="channel4"
auto-startup="${DiagCorrDictIsExport}">
<int:poller cron="${DiagCorrDictInterval}" />
<int:header name="exportType" value="诊断是否符合参数表" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exportStaffVsGroup"
ref="DataBaseService" method="exportStaffVsGroup" channel="channel4"
auto-startup="${StaffVsGroupIsExport}">
<int:poller cron="${StaffVsGroupInterval}" />
<int:header name="exportType" value="员工分组情况" />
</int:inbound-channel-adapter> <int:inbound-channel-adapter id="exportPatsInHospital"
ref="DataBaseService" method="exportPatsInHospital" channel="channel4"
auto-startup="${PatsInHospitalIsExport}">
<int:poller cron="${PatsInHospitalInterval}" />
<int:header name="exportType" value="住院信息" />
</int:inbound-channel-adapter>
<!-- 建立一个channel 即连接数据库获取到的记录的channel -->
<int:channel id="channel1"> <!-- <int:interceptors> -->
<!-- <int:wire-tap channel="logger" /> -->
<!-- </int:interceptors> -->
</int:channel> <!-- 分割一个数组 分割成一条条的记录 -->
<int:splitter id="testSplitter" input-channel="channel1"
output-channel="channel2" /> <int:splitter id="testSplitter1" input-channel="Clinicchannel1"
output-channel="Clinicchannel2" /> <int:channel id="channel2">
<int:queue capacity="10" />
</int:channel>
<int:channel id="Clinicchannel2">
<int:queue capacity="10" />
</int:channel> <int:header-enricher input-channel="channel2"
output-channel="channel3">
<int:header name="exportType" value="患者住院信息" />
<int:header name="patientId" expression="payload.patientId" />
<int:header name="visitId" expression="payload.visitId" />
<int:header name="catalogDate" expression="payload.catalogDate" />
<int:header name="exportManner" value="auto"></int:header>
</int:header-enricher> <int:header-enricher input-channel="Clinicchannel2"
output-channel="Clinicchannel3">
<int:header name="exportType" expression="'门诊信息'+payload.visitDate+payload.visitNo" />
<int:header name="visitDate" expression="payload.visitDate" />
<int:header name="visitNo" expression="payload.visitNo" />
<int:header name="exportManner" value="auto"></int:header>
</int:header-enricher> <int:channel id="channel3">
<int:queue capacity="10" />
</int:channel> <int:channel id="Clinicchannel3">
<int:queue capacity="10" />
</int:channel> <!-- <int:chain input-channel="channel3" output-channel="channel3x"> -->
<!-- <int:header-enricher> -->
<!-- <int:header name="exportManner" value="auto" /> --> <!-- </int:header-enricher> -->
<!-- <int:filter ref="mapper" /> -->
<!-- </int:chain> --> <int:filter input-channel="channel3" output-channel="channel3x"
ref="mapper" /> <int:splitter input-channel="channel3x" output-channel="channel4"
ref="DataBaseService" method="dispatch" /> <int:splitter input-channel="Clinicchannel3"
output-channel="channel4" ref="ClinicService" method="dispatch" /> <int:channel id="channel4">
<int:queue capacity="1" />
</int:channel> <int:chain input-channel="channel4" output-channel="channel5"> <int:header-enricher>
<int:header name="exportSize" expression="payload.getSize()" /> </int:header-enricher>
<int:transformer ref="mapper" />
</int:chain> <int:publish-subscribe-channel id="channel5" /> <!-- 把转换好的xml输出到一个目录下 -->
<!--<int-file:outbound-channel-adapter
channel="channel5" id="filesOut" directory="D:\数据交换平台导出目录" charset="UTF-8"
filename-generator-expression="headers.get('patientId') == null ? headers.exportType + '-' + @mapper.getFileCreatedTime() +'.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + @mapper.getFileCreatedTime() + '.xml'" />--> <!--<int-file:outbound-channel-adapter
channel="channel5" id="filesOut" directory="D:\" />--> <!-- 把转换好的xml输出到一个目录下 -->
<!-- <int-file:outbound-channel-adapter -->
<!-- channel="channel5" id="filesOutbackup" directory="D:\bbb" charset="UTF-8" -->
<!-- filename-generator-expression="headers.get('patientId') == null ? headers.exportType
+ '-' + '.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId
+ '-' + @mapper.getFileCreatedTime() + '.xml'" / -->
<int:bridge input-channel="channel5" output-channel="channel6">
</int:bridge>
<int:channel id="channel6">
<int:queue capacity="100" />
</int:channel>
<int:chain input-channel="channel6" output-channel="logger"> <int:service-activator ref="exportFile" method="saveFile">
<int:poller receive-timeout="5000" fixed-rate="100" />
</int:service-activator>
</int:chain> <int:chain input-channel="channel5">
<int:filter expression="headers.get('patientId') != null" />
<int:service-activator ref="AnalyseXMLService"
method="callJar">
<int:poller receive-timeout="5000" fixed-rate="200" />
</int:service-activator>
</int:chain> <int:channel id="channelBLGenerator">
<int:queue capacity="100" />
</int:channel>
<int:chain input-channel="channelBLGenerator" output-channel="logger">
<int:filter expression="headers.get('patientId') != null" />
<int:service-activator ref="blexportFile"
method="saveFile">
<int:poller receive-timeout="5000" fixed-rate="200" />
</int:service-activator>
</int:chain> <bean id="blexportFile" class="com.tjbt.hiscase.service.ExportFile"
autowire="byType">
<property name="directory" value="D:\数据交换平台导入目录\bl"></property>
<property name="charset" value="UTF-8"></property>
<property name="filename_generator_expression"
value="headers.get('patientId') == null ? headers.exportType + '-' + '.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + '.xml'" />
</bean> <!--<int-stream:stdout-channel-adapter
channel="logger" append-newline="true" />--> <int:wire-tap pattern="*" order="1" channel="logger" /> <int:channel id="logger">
<int:queue capacity="1000" />
</int:channel> <int:channel id="errorChannel">
<int:queue capacity="500" />
</int:channel>
<bean id="exportLoggerInterceptor" class="com.tjbt.hiscase.tools.ExportLoggerInterceptor">
</bean>
<bean id="exportFile" class="com.tjbt.hiscase.service.ExportFile"
autowire="byType">
<property name="directory" value="D:\数据交换平台导入目录"></property>
<property name="charset" value="UTF-8"></property>
<property name="filename_generator_expression"
value="headers.get('patientId') == null ? headers.exportType + '-' + '.xml' : headers.exportType +'-' + headers.patientId + '-' + headers.visitId + '-' + '.xml'" />
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int-event="http://www.springframework.org/schema/integration/event"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xmlns:int-groovy="http://www.springframework.org/schema/integration/groovy"
xmlns:int-http="http://www.springframework.org/schema/integration/http"
xmlns:int-httpinvoker="http://www.springframework.org/schema/integration/httpinvoker"
xmlns:int-ip="http://www.springframework.org/schema/integration/ip"
xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/integration/groovy http://www.springframework.org/schema/integration/groovy/spring-integration-groovy-2.0.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc-2.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/event http://www.springframework.org/schema/integration/event/spring-integration-event-2.0.xsd
http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http-2.0.xsd
http://www.springframework.org/schema/integration/ftp http://www.springframework.org/schema/integration/ftp/spring-integration-ftp-2.0.xsd
http://www.springframework.org/schema/integration/feed http://www.springframework.org/schema/integration/feed/spring-integration-feed-2.0.xsd
http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip-2.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/integration/httpinvoker http://www.springframework.org/schema/integration/httpinvoker/spring-integration-httpinvoker-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="com.tjbt.hiscase.tools" /> <!-- poller 轮循病历 找到文件的目录 filename-pattern="*.xml" 找到.xml 没有的过滤掉-->
<int-file:inbound-channel-adapter id="blfilesIn"
directory="D:\数据交换平台导入目录\bl" prevent-duplicates="false" filename-pattern="*.xml">
<int:poller fixed-rate="1000" /> </int-file:inbound-channel-adapter> <int-file:file-to-string-transformer
input-channel="blfilesIn" delete-files="true" output-channel="blString"
charset="UTF-8" /> <int:channel id="blString">
<int:queue capacity="10" />
</int:channel> <int:service-activator ref="AnalyseXMLService"
method="analyseHiscase" input-channel="blString" output-channel="channel5">
<int:poller receive-timeout="5000" fixed-rate="1000" />
</int:service-activator>
<!-- <int:chain id="main-chain" input-channel="blfilesIn" output-channel="blString"> -->
<!-- <int:header-enricher> -->
<!-- <int:header name="filename" expression="payload.getName()" /> -->
<!-- </int:header-enricher> -->
<!-- <int-file:file-to-string-transformer delete-files="true" charset="UTF-8"
/> -->
<!-- </int:chain> --> <!-- <int:channel id="blString"> -->
<!-- <int:queue capacity="10" /> -->
<!-- </int:channel> --> <!-- <int:router input-channel="blString" -->
<!-- expression="headers.filename.substring(headers.filename.indexOf('_')+1).startsWith('病程记录')"> -->
<!-- <int:mapping value="true" channel="bcjlChannel" /> -->
<!-- <int:mapping value="false" channel="fbcjlChannel"/> -->
<!-- <int:poller fixed-rate="1000" /> -->
<!-- </int:router> --> <!-- <int:channel id="bcjlChannel"> -->
<!-- <int:queue capacity="10" /> -->
<!-- </int:channel> --> <!-- <int:channel id="fbcjlChannel"> -->
<!-- <int:queue capacity="10" /> -->
<!-- </int:channel> --> <!-- 病程类文件保存方法 -->
<!-- <int:service-activator ref="AnalyseXMLService" -->
<!-- method="analyseHisProcess" input-channel="bcjlChannel" output-channel="channel5"> -->
<!-- <int:poller receive-timeout="5000" fixed-rate="1000" /> -->
<!-- </int:service-activator> --> <!-- poller 轮循 找到文件的目录 -->
<int-file:inbound-channel-adapter id="filesIn"
directory="D:\数据交换平台导入目录" prevent-duplicates="false" filename-pattern="*.xml" >
<int:poller fixed-rate="1000" />
<!-- <int-file:nio-locker/> -->
</int-file:inbound-channel-adapter> <!-- 把文件转换成String -->
<int-file:file-to-string-transformer
input-channel="filesIn" output-channel="output" delete-files="true"
charset="UTF-8" /> <int:channel id="output">
<int:queue capacity="10" />
</int:channel> <int:transformer ref="mapper" input-channel="output"
output-channel="channel3">
<int:poller max-messages-per-poll="1" cron="0-59 * * * * ?" />
</int:transformer> <int:channel id="channel3">
<int:queue capacity="10" />
</int:channel> <int:service-activator ref="DataBaseService"
method="saveAll" input-channel="channel3" output-channel="channel5">
<int:poller receive-timeout="5000" fixed-rate="100" />
</int:service-activator> <int:channel id="channel5">
<int:queue capacity="1000" />
</int:channel> <int:chain input-channel="channel5" output-channel="logger">
<int:header-enricher>
<int:header name="importType" value="患者住院信息" />
</int:header-enricher>
</int:chain> <int:wire-tap pattern="*" order="3" channel="logger" /> <int:channel id="logger">
<int:queue capacity="1000" />
</int:channel> <!-- 准备一个线程池 -->
<task:executor id="taskExecutor" pool-size="50"
queue-capacity="20" /> <int:channel id="errorChannel">
<int:queue capacity="500" />
</int:channel>
<int:poller id="globalPoller" default="true"
max-messages-per-poll="1" cron="0-59 * * * * ?" />
</beans>

上述是我们做的一个数据交换平台,主要完成数据的抽取工作,分为人工和手工的数据抽取。

数据源:

  文件系统

  数据库

  FTP数据源

  JMS消息数据源

通过上述的了解,我们大致可以了解ETL,其实ETL仅仅是数据交换平台的一个过程

  

ESB的编程模型(场景)的更多相关文章

  1. BPM编程模型(场景)

    一直开发基于操作的业务系统,主要就是通过界面,用户提交一些数据完成任务,大多数涉及多人协作的,基本都是浏览,少数可能对其进行审批,这里的审批不是电子政务那样的多人审批任务,仅仅是对数据的一个操作而已, ...

  2. ETL编程模型(场景)

    使用场景: ETL是一个处理过程. 多个数据源之间进行数据同步 1:n:一对多同步数据 n:1:多个数据源到一个目的段 m;n:多个数据源多个目的段 ========================= ...

  3. 系统编程-网络-tcp客户端服务器编程模型(续)、连接断开、获取连接状态场景

    相关博文: 系统编程-网络-tcp客户端服务器编程模型.socket.htons.inet_ntop等各API详解.使用telnet测试基本服务器功能 接着该上篇博文,咱们继续,首先,为了内容的完整性 ...

  4. Spring Batch批处理以及编程模型

    1.批处理: 类似于SQL里面的批处理提交 2.场景: 业务定时进行批处理操作,但是批处理的编程模型是怎么的呢? 3.开源框架 Spring Batch 4.编程模型: reader-processo ...

  5. 云巴:基于MQTT协议的实时通信编程模型

    概要 有人常问,云巴实时通信系统到底提供了一种怎样的服务,与其他提供推送或 IM 服务的厂商有何本质区别.其实,从技术角度分析,云巴与其它同类厂商都是面向开发者的通信服务,宏观的编程模型都是大同小异, ...

  6. 【温故知新】c#异步编程模型(APM)--使用委托进行异步编程

    当我们用到C#类许多耗时的函数XXX时,总会存在同名的类似BeginXXX,EndXXX这样的函数. 例如Stream抽象类的Read函数就有 public abstract int Read(byt ...

  7. mapreduce编程模型你知道多少?

    上次新霸哥给大家介绍了一些hadoop的相关知识,发现大家对hadoop有了一定的了解,但是还有很多的朋友对mapreduce很模糊,下面新霸哥将带你共同学习mapreduce编程模型. mapred ...

  8. Dubbo 新编程模型之外部化配置

    外部化配置(External Configuration) 在Dubbo 注解驱动例子中,无论是服务提供方,还是服务消费方,均需要转配相关配置Bean: @Bean public Applicatio ...

  9. Spark:Spark 编程模型及快速入门

    http://blog.csdn.net/pipisorry/article/details/52366356 Spark编程模型 SparkContext类和SparkConf类 代码中初始化 我们 ...

随机推荐

  1. Linux 之 tar和nc传文件

    前提: 将 172.16.88.1 上的 test 文件夹传送到 172.16.88.2 上 接收方 ---- 172.16.88.2 $ nc -l > test.tar 9876 为端口号 ...

  2. 微信小程序之蓝牙开发(详细读数据、写数据、附源码)

    本文将详细介绍微信小程序的蓝牙开发流程(附源码)准备:微信只支持低功耗蓝牙也就是蓝牙4.0,普通的蓝牙模块是用不了的,一定要注意. 蓝牙可以连TTL接到电脑上,再用XCOM调试 一开始定义的变量 va ...

  3. 温度传感器的AD值,电压和电阻的计算方法

    V是输入的电压,VCC是标准电压,R为固定电阻,NTC为热敏电阻.计算公式是V=(NTC/(NTC+R))*VCC电压或电阻转化AD的计算方式为AD=(V/VCC)*2^n=(NTC/(NTC+R)) ...

  4. .net core grpc 实现通信(一)

    现在系统都服务化,.net core 实现服务化的方式有很多,我们通过grpc实现客户端.服务端通信. grpc(https://grpc.io/)是google发布的一个开源.高性能.通用RPC(R ...

  5. 【转】每天一个linux命令(47):iostat命令

    原文网址:http://www.cnblogs.com/peida/archive/2012/12/28/2837345.html Linux系统中的 iostat是I/O statistics(输入 ...

  6. Oracle 表空间与数据文件

    -============================== --Oracle 表空间与数据文件 --============================== /* 一.概念 表空间:是一个或多 ...

  7. vue 文件中的注释

    在每个代码块内,注释的时候,需要使用各自语言的注释语法去注释(HTML.CSS.JavaScript.Jade 等).在文件最顶部注释的时候用HTML的注释语法:<!- 在这里写注释的内容 -- ...

  8. 箭头函数中的 this

    JS 每一个 function 都有自己独立的运行上下文,但箭头函数不属于普通的 function,所以没有独立的上下文. 所以在箭头函数里写的 this 其实是包含该箭头函数最近的一个 functi ...

  9. shell教程-001:shell简介 什么是shell,shell命令的两种执行方式

    Shell本身是一个用C语言编写的程序,它是用户使用Unix/Linux的桥梁,用户的大部分工作都是通过Shell完成的. Shell既是一种命令语言,又是一种程序设计语言.作为命令语言,它交互式地解 ...

  10. PHP安全相关的配置(1)

    PHP作为一门强大的脚本语言被越来越多的web应用程序采用,不规范的php安全配置可能会带来敏感信息泄漏.SQL注射.远程包含等问题,规范的安全配置可保障最基本的安全环境.下面我们分析几个会引发安全问 ...