| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <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" |
| 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"> |
| |
| <bean id="getQueue" class="java.lang.String"> |
| <constructor-arg value="replicationGetQueue" /> |
| </bean> |
| |
| <bean id="getTopic" class="java.lang.String"> |
| <constructor-arg value="replicationTopic" /> |
| </bean> |
| |
| <import resource="JMSReplicationCache1.xml"/> |
| <import resource="JMSReplicationCache2.xml"/> |
| <import resource="JMSReplicationCache3.xml"/> |
| |
| <camelContext xmlns="http://camel.apache.org/schema/spring"> |
| <camel:endpoint id="fooCache1" uri="cache:foo?cacheManagerFactory=#cacheManagerFactory1&eventListenerRegistry=#eventListenerRegistry1&cacheLoaderRegistry=#cacheLoaderRegistry1"/> |
| <camel:endpoint id="fooCache2" uri="cache:foo?cacheManagerFactory=#cacheManagerFactory2&eventListenerRegistry=#eventListenerRegistry2&cacheLoaderRegistry=#cacheLoaderRegistry2"/> |
| <camel:endpoint id="fooCache3" uri="cache:foo?cacheManagerFactory=#cacheManagerFactory3&eventListenerRegistry=#eventListenerRegistry3&cacheLoaderRegistry=#cacheLoaderRegistry3"/> |
| |
| <camel:route> |
| <camel:from uri="direct:addRoute"/> |
| <camel:setHeader headerName="CamelCacheOperation"> |
| <camel:constant>CamelCacheAdd</camel:constant> |
| </camel:setHeader> |
| <camel:setHeader headerName="CamelCacheKey"> |
| <camel:constant>foo</camel:constant> |
| </camel:setHeader> |
| <camel:to ref="fooCache1"/> |
| </camel:route> |
| |
| <camel:route> |
| <camel:from uri="direct:getRoute1"/> |
| <camel:setHeader headerName="CamelCacheOperation"> |
| <camel:constant>CamelCacheGet</camel:constant> |
| </camel:setHeader> |
| <camel:setHeader headerName="CamelCacheKey"> |
| <camel:constant>foo</camel:constant> |
| </camel:setHeader> |
| <camel:to ref="fooCache2"/> |
| <camel:choice> |
| <camel:when> |
| <camel:simple>${in.header.CamelCacheElementWasFound} != null</camel:simple> |
| <camel:to uri="mock:result1" /> |
| </camel:when> |
| </camel:choice> |
| </camel:route> |
| |
| <camel:route> |
| <camel:from uri="direct:getRoute2"/> |
| <camel:setHeader headerName="CamelCacheOperation"> |
| <camel:constant>CamelCacheGet</camel:constant> |
| </camel:setHeader> |
| <camel:setHeader headerName="CamelCacheKey"> |
| <camel:constant>foo</camel:constant> |
| </camel:setHeader> |
| <camel:to ref="fooCache3"/> |
| <camel:choice> |
| <camel:when> |
| <camel:simple>${in.header.CamelCacheElementWasFound} != null</camel:simple> |
| <camel:to uri="mock:result2" /> |
| </camel:when> |
| </camel:choice> |
| </camel:route> |
| |
| </camelContext> |
| |
| <bean id="amqCF" class="org.apache.activemq.ActiveMQConnectionFactory"> |
| <property name="brokerURL" value="vm://localhost?broker.persistent=false"/> |
| </bean> |
| |
| <bean id="activemq" class="org.apache.camel.component.jms.JmsComponent"> |
| <property name="connectionFactory"> |
| <ref bean="amqCF"/> |
| </property> |
| </bean> |
| |
| </beans> |