2 Replies Latest reply on Jan 15, 2010 10:07 PM by noelo

    Injecting JGroups configuration

    noelo

      Hi,

      I'm currently trying to build a demo on EC2 which requires the address [ip:port] of a jgroups gossip router. This address is dynamic each time the gossip router node is restarted. Currently to inject the address I do a search/replace on a tag in the jgroups config and then pass that config onto infinispan via the GlobalConfiguration.setTransportProperties method.

       

      Also I was wondering if there is a way to partition the configuration e.g. have a global configuration file and then a cache configuration file.

      I see that the one of the constructors of the DefaultCacheManager takes a global configuration and a default configuration object as parameters but I can't see a way of parsing and creating these GlobalConfiguration and Configuration objects from XML files.

       

      Any ideas ?

        • 1. Re: Injecting JGroups configuration
          manik

          noelo wrote:

           

          Hi,

          I'm currently trying to build a demo on EC2 which requires the address [ip:port] of a jgroups gossip router. This address is dynamic each time the gossip router node is restarted. Currently to inject the address I do a search/replace on a tag in the jgroups config and then pass that config onto infinispan via the GlobalConfiguration.setTransportProperties method.

           

          You could pass it in to the VM as a system property (-Dmy.gossip.router=1.2.3.4:1234) and then refer to this in your config file (<.... router="${my.gossip.router}" .... >).  These are substituted when parsing the XML so you don't need to bother with search/replace yourself.

           

          noelo wrote:

           

          Also I was wondering if there is a way to partition the configuration e.g. have a global configuration file and then a cache configuration file.

          I see that the one of the constructors of the DefaultCacheManager takes a global configuration and a default configuration object as parameters but I can't see a way of parsing and creating these GlobalConfiguration and Configuration objects from XML files.

           

          There is no way today, but it is a reasonable request.  Feel like creating a JIRA, contributing it?    Should be pretty straightforward.

           

          Cheers

          Manik

          • 2. Re: Injecting JGroups configuration
            noelo

            Thanks Manik,

             

            Sure, I'll look after it.. https://jira.jboss.org/jira/browse/ISPN-332

             

            cheers

            Noel