Announcement Announcement Module
Collapse
No announcement yet.
MongoDB configuration question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MongoDB configuration question

    Hello:

    I'm using STS 2.8.1 and deploying/testing my app in cloud foundry.

    Can I configure 2 MongoTemplate config items in the configuration so I can choose to use a mongo db instances that matches a certain criteria. Here's the config snippet:

    Code:
    <mongo:repositories base-package="com.blah"/>
    
        <!-- To translate any MongoExceptions thrown in @Repository annotated classes -->
        <context:annotation-config/>
    
        <bean class="org.springframework.data.mongodb.core.MongoTemplate" id="mongoTemplate">
            <constructor-arg ref="mongoDbFactory"/>
        </bean>
    	<cloud:mongo-db-factory id="mongoDbFactory"/>
    	
    	<bean class="org.springframework.data.mongodb.core.MongoTemplate" id="project1MongoTemplate">
            <constructor-arg ref="project1MongoDbFactory"/>
            </bean>
    	<cloud:mongo-db-factory id="project1MongoDbFactory" service-name="project1"/>
    where project1 is 2nd mongodb service and mongoTemplate uses the default mongodb service.
Working...
X