首页 > 其他分享 >mule9.0 springappcation.xml

mule9.0 springappcation.xml

时间:2023-08-02 17:36:24浏览次数:36  
标签:xml Mapper mule9.0 generic classpath springappcation config

<?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>

标签:xml,Mapper,mule9.0,generic,classpath,springappcation,config
From: https://www.cnblogs.com/guanchaoguo/p/17601285.html

相关文章

  • xml
    xml作为配置文件的优势我们之前尝试过使用properties文件作为我们的配置文件,但是当我们的内容较多的时候,我们文件的可读性见会非常差而我们使用xml文件则会清晰明了XML-概括XML-标签的规则XML-语法规则version的值默认为1.0在一个xml文件中跟标签有且只有一个xml......
  • JAXB2(Java Architecture for XML Binding)
    JAXB2(JavaArchitectureforXMLBinding)是Java平台上的一个标准API,用于将XML数据和Java对象之间进行相互转换,即实现XML和Java对象之间的数据绑定。解释如下:XML是一种标记语言,常用于在不同系统之间传递数据。XML数据由标签和属性组成,具有良好的可读性和可扩展性......
  • WEB漏洞—XXE&XML之利用检测绕过全解
    一.基础概念1.XMLXML被设计为传输和存储数据,XML文档结构包括XML声明、DTD文档类型定义(可选)、文档元素,其焦点是数据的内容,其把数据从HTML分离,是独立于软件和硬件的信息传输工具。XXE漏洞全称XMLExternalEntityInjection,即xml外部实体注入漏洞,XXE漏洞发生在应用程序解析XML......
  • 记一次XML文件 批量添加属性
    publicstaticvoidmain(String[]age){try{List<Path>collect=Files.walk(Paths.get("D:\\modelform")).filter(Files::isRegularFile).collect(Collectors.toList());SAXReaderreader=newSAXReader();......
  • C# 反序列化报错 XML 文档(1, 2)中有错误:不应有 <xml xmlns=''>
    1.XmlSerializer症状用XmlSerializer进行xml反序列化的时候,程序报错:​不应有<xmlxmlns=''>。​​说明: ​执行当前Web请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 ​异常详细信息: ​System.InvalidOperatio......
  • error while loading shared libraries: libxml2.so.2: cannot open shared object fi
    参考:https://blog.csdn.net/qq_39779233/article/details/128215517  ============================================   errorwhileloadingsharedlibraries:libxml2.so.2:cannotopensharedobjectfile解决方法  解决方法:sudoapt-getinstalllibxml......
  • Maven配置中pom.xml和setting.xml之间的关系
    在日常的开发中,我们拿IDEA举例,一般会在电脑上自行下载安装Maven,然后在IDEA中配置我们安装的Maven路径,通过修改setting.xml文件,例如配置公共的镜像仓库地址,来提高依赖下载速率;或者配置内部私有的镜像仓库地址,来引入一些私有的依赖等等。1、如何从指定的镜像仓库下载依赖如下图在......
  • Mybatis学习(1)——mybatis介绍 & 入门案例 & 全局配置文件详解 & 增删改查 + mybatis事
    Mybatis学习(1)——mybatis介绍&入门案例&全局配置文件详解&增删改查+mybatis事务&mapper.xml文件#{}和${}&动态SQL入门原文链接:https://blog.csdn.net/Pireley/article/details/131520252目录引出一、mybatis是啥1.官网&ORM(ObjectRelationMapping)对象关......
  • Mybatis中的Mapper.xml映射文件sql查询接收多个参数 分页查询 sql语句动态生成的时候,
    Mybatis中的Mapper.xml映射文件sql查询接收多个参数分页查询sql语句动态生成的时候,使用${},sql语句中某个参数进行占位的时候用#{}原文链接:https://blog.csdn.net/Ep_Little_prince/article/details/100687848​我们都知道,在Mybatis中的Mapper.xml映射文件可以定制动态SQ......
  • Mapper.xml详解 一对一 多对一 多对多
    Mapper.xml详解Mapper.xml详解一对一多对一多对多原文链接:https://blog.csdn.net/qq_36850813/article/details/80037363 我们知道,每一款框架产品在实际开发中,都是通过XML文件来培训框架的相关流程的,MyBatis也不例外,主要有两个配置文件:config.xml和Mapper.xml,当然,这两种配......