All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.spring.camel-context.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Unless explicitly acquired and licensed from Licensor under another license, the contents of
    this file are subject to the Reciprocal Public License ("RPL") Version 1.5, or subsequent
    versions as allowed by the RPL, and You may not copy or use this file in either source code
    or executable form, except in compliance with the terms and conditions of the RPL

    All software distributed under the RPL is provided strictly on an "AS IS" basis, WITHOUT
    WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND LICENSOR HEREBY DISCLAIMS ALL SUCH
    WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    PARTICULAR PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific language
    governing rights and limitations under the RPL.

    http://opensource.org/licenses/RPL-1.5

    Copyright 2012-2015 Open Justice Broker Consortium

-->

<!-- Configures the Camel Context -->

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:camel="http://camel.apache.org/schema/spring"
	xmlns:cxf="http://camel.apache.org/schema/cxf" 
	xmlns:ir="http://ojbc.org/IEPD/Exchange/IncidentReport/1.0"
	xmlns:iru="http://ojbc.org/IEPD/Exchange/IncidentReportUpdate/1.0"	
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
       ">
	<!-- needed cxf imports -->
	<import resource="classpath:META-INF/cxf/cxf.xml" />	
	
	<camel:camelContext xmlns="http://camel.apache.org/schema/spring" id="incident-reporting-service-connector">
	
		<endpoint id="inputDir"
			uri="file:///${incidentChargeReporting.ConnectorFileDirectory}/input?idempotent=true&amp;moveFailed=${incidentChargeReporting.ConnectorFileDirectory}/error&amp;move=processed/&amp;include=.*.xml&amp;readLock=changed&amp;readLockCheckInterval=2500" />

		<endpoint id="deadLetterDir"
			uri="file:///${incidentChargeReporting.ConnectorFileDirectory}/deadLetter" />
			
		<!-- Incident Reporting Service Handler -->
		<camel:route id="IncidentReportingServiceHandlerRoute">
		
			<camel:from uri="inputDir" />
			<camel:log
				message="Received file for Incident Report Processing: ${file:name}" />
			
			<camel:convertBodyTo type="java.lang.String" charset="UTF-8"/>
			
			<camel:to uri="direct:derivedRoutes"/>	

			<camel:log message="\n\n Message Body after potential derived route call: \n ${body} \n\n" />

			<camel:filter>
				<camel:xpath>/ir:IncidentReport</camel:xpath>
				<camel:setHeader headerName="operationName">
					<constant>ReportIncident</constant>
				</camel:setHeader>
			</camel:filter>
			
			<camel:filter>
				<camel:xpath>/iru:IncidentReportUpdate</camel:xpath>
				<camel:setHeader headerName="operationName">
					<constant>ReportIncidentUpdate</constant>
				</camel:setHeader>
			</camel:filter>	
	                        		
			<camel:setHeader headerName="operationNamespace">
				<constant>http://ojbc.org/Services/WSDL/IncidentReportingService/1.0</constant>
			</camel:setHeader>
			
			
			<log message="\n\n\n operationName = ${in.headers.operationName} \n\n\n"/>
			
			<camel:throttle timePeriodMillis="1000">
				<constant>1</constant>
				<camel:to uri="IncidentReportingServiceEndpoint" />
			</camel:throttle>
			
			<camel:log message="Called intermediary" />

		</camel:route>
		
		
		<camel:route id="IncidentReportingConnector_DerivedRoutes">

			<camel:from uri="direct:derivedRoutes"/>
		
			<!-- Set up member specific endpoints -->
			<camel:setHeader headerName="routingSlipDerivedRoutes">
				<simple>{{incidentChargeReporting.camelEndpointsToCall}}</simple>
			</camel:setHeader>

			<camel:log message=
				"\n\n\n routingSlipDerivedRoutes: ${in.headers.routingSlipDerivedRoutes} \n\n\n"/>

			<camel:filter>
				<camel:simple>${in.headers.routingSlipDerivedRoutes} != ''</camel:simple>
				
				<camel:recipientList>
					<camel:header>routingSlipDerivedRoutes</camel:header>
				</camel:recipientList>
			</camel:filter>			
		
		</camel:route>		
		

	</camel:camelContext>
	
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy