Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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.
- -->
- <!-- Configures the Camel Context-->
- <!-- author: Muhammad Ichsan ([email protected]) -->
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd">
- <!-- ActiveMQ -->
- <bean name="activemq" class="org.apache.camel.component.jms.JmsComponent">
- <property name="connectionFactory" ref="jmsConnectionFactory" />
- </bean>
- <bean id="jmsConnectionFactory" class="org.jencks.amqpool.PooledConnectionFactory">
- <!-- <constructor-arg value="vm://localhost?broker.persistent=false" /> -->
- <!-- <constructor-arg value="tcp://localhost:61616?broker.persistent=false" /> Teknik ini tidak dapat menampilkan queue di webconsole -->
- <constructor-arg value="vm://localhost" /> <!-- Teknik ini dapat menampilkan queue di webconsole activemq-->
- <property name="maxConnections" value="8" />
- </bean>
- <bean class="id.co.mama.rxpoc.Biller">
- <property name="port" value="4488"/>
- </bean>
- <bean id="m2mAdapter" class="id.co.mama.rxpoc.BillerAdapter">
- <property name="hostname" value="localhost" />
- <property name="port" value="4488" />
- <property name="jmsTemplate" ref="jmsTemplate" />
- <property name="innerDestinationName" value="poc.m2m.adapter.out" />
- </bean>
- <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
- <property name="connectionFactory" ref="jmsConnectionFactory" />
- <property name="destinationName" value="poc.m2m.adapter.in" />
- <property name="messageListener" ref="m2mAdapter" />
- <property name="concurrentConsumers" value="15" />
- </bean>
- <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
- <property name="connectionFactory">
- <ref bean="jmsConnectionFactory" />
- </property>
- <property name="receiveTimeout">
- <value>20000</value>
- </property>
- </bean>
- <bean id="fakerxCore" class="id.co.mama.rxpoc.QueueAutoAnalyzer">
- <property name="innerDestinationName" value="poc.rx_in"/>
- <property name="jmsTemplate" ref="jmsTemplate" />
- </bean>
- <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
- <property name="connectionFactory" ref="jmsConnectionFactory" />
- <property name="destinationName" value="poc.rx_out" />
- <property name="messageListener" ref="fakerxCore" />
- <property name="concurrentConsumers" value="15" />
- </bean>
- <bean id="reverser" class="id.co.mama.learn.camelspeed.StringReverser" />
- <bean id="consolePrinter" class="id.co.mama.learn.camelspeed.ConsolePrinter" />
- <bean id="speaker" class="id.co.mama.learn.camelspeed.Speaker" />
- <camelContext xmlns="http://camel.apache.org/schema/spring">
- <!-- @rx -->
- <route>
- <from uri="activemq:poc.rx_in?concurrentConsumers=15"/>
- <onException>
- <exception>org.apache.camel.ExchangeTimedOutException</exception>
- <!-- mark this as handled -->
- <handled><constant>true</constant></handled>
- <wireTap uri="direct:saySomething">
- <body><constant>OMG! Timeout in inOut poc.m2m.invoker.in</constant></body>
- </wireTap>
- <to uri="direct:timeOut" />
- </onException>
- <inOut uri="activemq:poc.m2m.invoker.in" />
- <!--
- <to uri="bean:reverser?method=reverse" />
- -->
- <to uri="bean:consolePrinter?method=print" />
- <to uri="activemq:poc.rx_out"/>
- </route>
- <!-- @Invoker -->
- <route>
- <from uri="activemq:poc.m2m.invoker.in?concurrentConsumers=15"/>
- <onException>
- <exception>org.apache.camel.ExchangeTimedOutException</exception>
- <!-- mark this as handled -->
- <handled><constant>true</constant></handled>
- <wireTap uri="direct:saySomething">
- <body><constant>OMG! Timeout inOut poc.m2m.adapter.in</constant></body>
- </wireTap>
- <to uri="direct:timeOut" />
- </onException>
- <!-- <inOut uri="activemq:poc.m2m.adapter.in?replyTo=queue:poc.m2m.adapter.out"/> -->
- <to uri="bean:reverser?method=reverse" />
- <to uri="bean:consolePrinter?method=print"/>
- </route>
- <route>
- <from uri="direct:timeOut" />
- <to uri="bean:speaker?method=announceTimeout" />
- <to uri="bean:consolePrinter?method=print" />
- </route>
- <route>
- <from uri="direct:saySomething" />
- <to uri="bean:consolePrinter?method=print" />
- </route>
- </camelContext>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment