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

-->

<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" 
	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="custodyStatusChangeReportingCamelContext">
	
		<camel:endpoint id="custodyStatusChangeReportingServiceEndpoint"
			uri="cxf:bean:custodyStatusChangeReportingService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${custodyStatusChangeReporting.cxflogging}" />

		<camel:endpoint id="custodyAnalyticsStagingAdapterServiceEndpoint"
			uri="cxf:bean:custodyAnalyticsStagingAdapterService?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=${custodyStatusChangeReporting.cxflogging}" />
						

		<camel:route id="custodyStatusChangeReporting_route">
		
			<camel:from uri="custodyStatusChangeReportingServiceEndpoint" />
			
			<camel:log message="\n\n\n custodyStatusChangeReporting_route... \n\n\n"/>
			
			<camel:to uri="bean:messageProcessor?method=processRequestPayload"/>
			
			<!-- This will alter the original message to enrich if a URI property is set in the configuration file -->
			<camel:to uri="direct:enrichContent"/>

			<!-- Multicast to the core services and derived bundle specific routes so each route gets original message.  -->
			<camel:multicast>				
			
				<camel:pipeline>
					<camel:filter>
						<camel:simple>${properties:custodyStatusChangeReporting.callCustodyAnalyticsStageAdapter} == true</camel:simple>
						
						<camel:log message="\n\n\n Calling CustodyAnalyticsStageAdapter...\n\n\n"/>
						
						<camel:to uri="direct:callCustodyAnalyticsStageAdapter"/>
						
					</camel:filter>	
				</camel:pipeline>	
			
				<camel:pipeline>
					<camel:to uri="direct:derivedRoutes"/>
				</camel:pipeline>
			</camel:multicast>
			
		</camel:route>

		<camel:route id="enrichContentRoute">

			<camel:from uri="direct:enrichContent"/>
		
			<!-- Set up derived endpoints -->
			<camel:setHeader headerName="routingSlipEnrichContent"><simple>{{custodyStatusChangeReporting.enrichContentURI}}</simple></camel:setHeader>

			<camel:filter>
				<camel:simple>${in.headers.routingSlipEnrichContent} != ''</camel:simple>
				
				<camel:log message="About to call content enricher using this routing slip: ${in.headers.routingSlipEnrichContent}"/>
				
				<camel:recipientList>
					<camel:header>routingSlipEnrichContent</camel:header>
				</camel:recipientList>
			</camel:filter>			
		
		</camel:route>					
		
		<camel:route id="derivedRoutes">

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

			<camel:filter>
				<camel:simple>${in.headers.routingSlipDerivedRoutes} != ''</camel:simple>
				
				<camel:log message="\n\n\n Calling derived routes with routing slip: ${in.headers.routingSlipDerivedRoutes} \n\n\n"/>
				
				<camel:recipientList>
					<camel:header>routingSlipDerivedRoutes</camel:header>
				</camel:recipientList>
			</camel:filter>			
		
		</camel:route>		
		
		<route id="custodyAnalyticsStageAdapter_route">
            
            <from uri="direct:callCustodyAnalyticsStageAdapter"/>
            
            <log message="\n\n\n custodyAnalyticsStageAdapter_route... \n\n\n" />
											
			<camel:to uri="bean:messageProcessor?method=prepareNewExchangeResponseMessage"/>			
							
			<camel:setHeader headerName="operationName"><constant>ReportCustodyStatusChange</constant></camel:setHeader>	
			<camel:setHeader headerName="operationNamespace"><constant>http://ojbc.org/Services/WSDL/CustodyStatusChangeReportingService/1.0</constant></camel:setHeader>
         					
            <camel:throttle timePeriodMillis="1000">
            	<constant>1</constant>
            	<to uri="custodyAnalyticsStagingAdapterServiceEndpoint"/>
        	</camel:throttle>    
            
        </route>		
		
	</camel:camelContext>
	
	<bean id="messageProcessor" class="org.ojbc.util.camel.processor.MessageProcessor" />
	
	<!-- See this thread: http://stackoverflow.com/questions/11195506/increase-executor-queue-size-in-cxf-onewayprocessorinterceptor -->
    <bean id="cxf.default.workqueue" class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
        <property name="name" value="default" />
        <property name="queueSize" value="2048" />
    </bean>	
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy