mule9.0 springappcation.xml

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

<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
      xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
      xmlns:db="http://www.mulesoft.org/schema/mule/db"
      xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc"
      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
      xmlns:json="http://www.mulesoft.org/schema/mule/json"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:http="http://www.mulesoft.org/schema/mule/http"
      xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd">

    <spring:beans>
        <context:property-placeholder location="classpath*:config/metadata.properties,classpath*:config/environment.properties"/>

        <!-- 数据源配置 -->
        <spring:bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
            <spring:property name="driverClassName" value="${driverClass}"/>
            <spring:property name="url" value="${jdbcUrl}"/>
            <spring:property name="username" value="${user}"/>
            <spring:property name="password" value="${password}"/>
            <!-- 配置初始化大小、最小、最大 -->
            <spring:property name="initialSize" value="${initialPoolSize}"/>
            <spring:property name="minIdle" value="${minIdle}"/>
            <spring:property name="maxActive" value="${maxPoolSize}"/>
            <!-- 配置获取连接等待超时的时间 -->
            <spring:property name="maxWait" value="${maxWait}"/>
            <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
            <spring:property name="timeBetweenEvictionRunsMillis" value="${timeBetweenEvictionRunsMillis}"/>
            <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
            <spring:property name="minEvictableIdleTimeMillis" value="${minEvictableIdleTimeMillis}"/>
            <spring:property name="validationQuery" value="SELECT 'x' "/>
            <spring:property name="testWhileIdle" value="true"/>
            <spring:property name="testOnBorrow" value="false"/>
            <spring:property name="testOnReturn" value="false"/>
            <!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
            <spring:property name="poolPreparedStatements" value="true"/>
            <spring:property name="maxPoolPreparedStatementPerConnectionSize" value="20"/>
            <!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
            <spring:property name="filters" value="stat"/>
        </spring:bean>

        <context:component-scan base-package="com.audaque.dses.esb" />


        <spring:bean id="sqlSessionFactoryBean" class="com.audaque.dses.esb.ext.GsbSqlSessionFactoryBean">
            <spring:property name="databaseType" value="mysql"/>
            <spring:property name="dataSource" ref="dataSource"/>
            <spring:property name="configLocation" value="classpath:config/mybatis-config.xml"/>
            <spring:property name="xmlMapperLocations">
                <spring:list>
                    <spring:value>classpath*:config/gsb/generic/*Mapper.xml</spring:value>
                    <spring:value>classpath*:config/gsb/mysql/*Mapper.xml</spring:value>
                    <spring:value>classpath*:config/system/generic/*Mapper.xml</spring:value>
                </spring:list>
            </spring:property>
        </spring:bean>

        <spring:bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
            <spring:property name="basePackage" value="com.audaque.dses.esb.dao"/>
            <spring:property name="sqlSessionFactoryBeanName" value="sqlSessionFactoryBean"/>
        </spring:bean>
    </spring:beans>
</mule>
posted @ 2023-08-02 17:21  vx_guanchaoguo0  阅读(5)  评论(0编辑  收藏  举报