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

  • Replica set configuration problem

    Hi,

    Is it possible to provide replica-set from property file?
    This works:
    <mongo:mongo replica-set="localhost:27017,localhost:27117">

    This does not:
    <mongo:mongo replica-set="${mongo.hosts}">

    It gives this kind of exception:
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    at org.springframework.data.mongodb.config.ParsingUti ls.parseReplicaSet(ParsingUtils.java:49)
    at org.springframework.data.mongodb.config.MongoParse r.doParse(MongoParser.java:49)
    at org.springframework.beans.factory.xml.AbstractSing leBeanDefinitionParser.parseInternal(AbstractSingl eBeanDefinitionParser.java:85)

    property file should be ok as I can provide other mongo parameters via it.

    -antti-

  • #2
    Did you get any solution?

    Let me know incase you find any approach or workaround for this?

    - Atish

    Comment


    • #3
      Here is how we do it. It's not elegant, but it works.

      Code:
      <mongo:mongo
      replica-set="${mongo.replicaset.1}:${mongo.replicaset.1.port},${mongo.replicaset.2}:${mongo.replicaset.2.port},${mongo.replicaset.3}:${mongo.replicaset.3.port}">
      Downside is you have to have multiple properties entries to get it to work correctly.
      Last edited by johannz; Nov 2nd, 2011, 12:09 PM. Reason: Fixing code tags

      Comment


      • #4
        Thanks for your suggestion.
        It worked fine.

        Comment


        • #5
          There is a Jira for that, which has been fixed on 1.0 RC1:

          https://jira.springsource.org/browse/DATAMONGO-316

          Comment

          Working...
          X