Advertisement
Guest User

Spring config

a guest
Feb 1st, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 4.03 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.    Licensed to the Apache Software Foundation (ASF) under one or more
  4.    contributor license agreements.  See the NOTICE file distributed with
  5.    this work for additional information regarding copyright ownership.
  6.    The ASF licenses this file to You under the Apache License, Version 2.0
  7.    (the "License"); you may not use this file except in compliance with
  8.    the License.  You may obtain a copy of the License at
  9.  
  10.    http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12.    Unless required by applicable law or agreed to in writing, software
  13.    distributed under the License is distributed on an "AS IS" BASIS,
  14.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.    See the License for the specific language governing permissions and
  16.    limitations under the License.
  17. -->
  18. <beans xmlns="http://www.springframework.org/schema/beans"
  19.       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  20.       xmlns:context="http://www.springframework.org/schema/context"
  21.       xmlns:camel="http://camel.apache.org/schema/spring"
  22.       xsi:schemaLocation="
  23.       http://www.springframework.org/schema/beans
  24.       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  25.       http://www.springframework.org/schema/context
  26.       http://www.springframework.org/schema/context/spring-context-3.0.xsd
  27.       http://camel.apache.org/schema/spring
  28.       http://camel.apache.org/schema/spring/camel-spring.xsd">
  29.  
  30.  
  31.  
  32.  
  33.  
  34.     <!-- JPA Persistence -->
  35.     <bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent">
  36.         <property name="entityManagerFactory" ref="entityManagerFactory"/>
  37.     </bean>
  38.  
  39.     <bean id="entityManagerFactory"
  40.          class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
  41.         <property name="persistenceUnitName" value="aim-pu"/>
  42.         <property name="jpaVendorAdapter" ref="jpaAdapter"/>
  43.     </bean>
  44.  
  45.     <bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
  46.         <property name="databasePlatform" value="org.eclipse.persistence.platform.database.OraclePlatform"/>
  47.         <property name="showSql" value="true"/>
  48.     </bean>
  49.  
  50.     <bean id="transactionTemplate"
  51.          class="org.springframework.transaction.support.TransactionTemplate">
  52.         <property name="transactionManager">
  53.             <bean class="org.springframework.orm.jpa.JpaTransactionManager">
  54.                 <property name="entityManagerFactory" ref="entityManagerFactory"/>
  55.             </bean>
  56.         </property>
  57.     </bean>
  58.  
  59.  
  60.     <!-- Camel Properties -->
  61.     <bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">
  62.         <property name="location" value="classpath:ribmessage.properties"/>
  63.     </bean>
  64.  
  65.  
  66.     <!-- ActiveMQ Connection Factory -->
  67.     <bean id="jmsConnectionFactory"
  68.          class="org.apache.activemq.ActiveMQConnectionFactory">
  69.         <property name="brokerURL" value="tcp://localhost:61616" />
  70.     </bean>
  71.  
  72.     <!-- ActiveMQ Connection Pooling-->
  73.     <bean id="pooledConnectionFactory"
  74.          class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
  75.         <property name="maxConnections" value="8" />
  76.         <property name="connectionFactory" ref="jmsConnectionFactory" />
  77.     </bean>
  78.  
  79.     <bean id="jmsConfig"
  80.          class="org.apache.camel.component.jms.JmsConfiguration">
  81.         <property name="connectionFactory" ref="pooledConnectionFactory"/>
  82.         <property name="concurrentConsumers" value="10"/>
  83.     </bean>
  84.  
  85.     <bean id="activemq"
  86.          class="org.apache.activemq.camel.component.ActiveMQComponent">
  87.         <property name="configuration" ref="jmsConfig"/>
  88.  
  89.         <!-- if we are using transacted then enable CACHE_CONSUMER (if not using XA) to run faster
  90.             see more details at: http://camel.apache.org/jms
  91.        <property name="transacted" value="true"/>
  92.        <property name="cacheLevelName" value="CACHE_CONSUMER" />
  93.        -->
  94.     </bean>
  95.  
  96. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement