download original
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:util="http://www.springframework.org/schema/util" xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<context:property-placeholder
location="classpath:/database.properties,classpath:/application.properties" />
<!-- <util:constant id="mongoWriteConcern" static-field="com.mongodb.WriteConcern.JOURNAL_SAFE" /> -->
<mongo:mongo id="mongo" host="${db.host}" port="${db.port}" />
<!-- <mongo:options connections-per-host="8"
threads-allowed-to-block-for-connection-multiplier="4"
connect-timeout="1000" max-wait-time="1500}" auto-connect-retry="true"
socket-keep-alive="true" socket-timeout="1500" slave-ok="true"
write-number="1" write-timeout="0" write-fsync="true" /> -->
<mongo:db-factory id="mongoDbFactory" dbname="${db.dbname}"
mongo-ref="mongo" write-concern="JOURNAL_SAFE" />
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
</bean>
<!-- Use this post processor to translate any MongoExceptions thrown in
@Repository annotated classes <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/> -->
<!-- enable component scanning -->
<context:component-scan base-package="de.oklischat" />
<!-- enable autowire -->
<context:annotation-config />
</beans>
back to resources
(C) 1998-2017 Olaf Klischat <olaf.klischat@gmail.com>