Files
MaxKey/maxkey-persistence/src/test/resources/spring/applicationContext.xml
Crystal.Sea 99e778f9ae run @Test
2020-09-03 21:50:56 +08:00

92 lines
4.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- dataSource define begin -->
<!-- dataSource configuration -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close" >
<!-- <property name="driverClass" value="#{dataSoruceConfig.driverClass}"/> -->
<property name="url" value="${spring.datasource.url}"/>
<property name="username" value="${spring.datasource.username}"/>
<property name="password" value="${spring.datasource.password}"/>
</bean>
<!-- Application properties configs -->
<bean id="propertySourcesPlaceholderConfigurer" class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:application.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
<!-- Authentication Password Encoder Config -->
<bean id="passwordEncoder" class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"></bean>
<bean id="passwordReciprocal" class="org.maxkey.crypto.password.PasswordReciprocal"></bean>
<!-- Datastore configuration -->
<import resource="applicationContext-persist.xml"/>
<bean id="kafkaProvisioningService" class="org.maxkey.identity.kafka.KafkaProvisioningService"></bean>
<bean id="applicationConfig" class="org.maxkey.configuration.ApplicationConfig"></bean>
<bean id="emailConfig" class="org.maxkey.configuration.EmailConfig"></bean>
<bean id="characterEncodingConfig" class="org.maxkey.configuration.CharacterEncodingConfig"></bean>
<bean id="loginConfig" class="org.maxkey.configuration.LoginConfig"></bean>
<bean id="passwordPolicyValidator" class="org.maxkey.persistence.db.PasswordPolicyValidator">
</bean>
<bean id="producerProperties" class="java.util.HashMap">
<constructor-arg>
<map>
<entry key="bootstrap.servers" value="${kafka.producer.bootstrap.servers}" />
<!--<entry key="group.id" value="${group.id}" />-->
<entry key="retries" value="${kafka.producer.retries}" />
<entry key="batch.size" value="${kafka.producer.batch.size}" />
<entry key="linger.ms" value="${kafka.producer.linger.ms}" />
<entry key="buffer.memory" value="${kafka.producer.buffer.memory}" />
<entry key="acks" value="${kafka.producer.acks}" />
<entry key="key.serializer" value="${kafka.producer.key.serializer}" />
<entry key="value.serializer" value="${kafka.producer.value.serializer}"/>
</map>
</constructor-arg>
</bean>
<!-- 创建kafkatemplate需要使用的producerfactory bean -->
<bean id="producerFactory"
class="org.springframework.kafka.core.DefaultKafkaProducerFactory">
<constructor-arg>
<ref bean="producerProperties" />
</constructor-arg>
</bean>
<!-- 创建kafkatemplate bean使用的时候只需要注入这个bean即可使用template的send消息方法 -->
<bean id="kafkaTemplate" class="org.springframework.kafka.core.KafkaTemplate">
<constructor-arg ref="producerFactory" />
<constructor-arg name="autoFlush" value="true" />
</bean>
<!-- 配置执行的任务列表 -->
<util:list id="businessTask" list-class="java.util.ArrayList">
</util:list>
</beans>