2 Replies Latest reply on Sep 14, 2011 2:03 PM by frankie007

    Configuring with management API without persisting changes in configuration xml

    frankie007

      Hi,

       

      Is there a way to use the Management API without persisting changes in the server config xml?

      I'll explain why I'm asking this.

       

      We're developping an application that will run in JBoss.

      The application will need to use and configure some JBoss components, but we want the application to be master of it's own configuration.

      In this way we can decouple our implementation from the server we're running on. If we would like to use another server (which we probably wont) we have the possibility to do this.

       

      To point out the problem I'm having, I'll explain it by using an example.

      Suppose that our application will use datasources. Therefore it has it's own configuration file, containing the configuration of the datasources.

      At startup the application will run through this configuration file and create all the datasources in JBoss using the Management API. The created datasources will be persisted in the config of JBoss. And there is our problem. At this moment our application is no longer master of configuration and we could no longer keep the two configuration files in sync (e.g. at server crash).

       

      We think of two solutions for this issue:

      - at startup first, delete all the datasources from JBoss using the Management API, then create them again based on the application configuration

      - don't persist the changes made by the Management API

       

      Off course we prefere the second option, but how can we achieve this?

       

       

      Thanks in advance for your help!

        • 1. Re: Configuring with management API without persisting changes in configuration xml
          jaikiran

          frankie007 wrote:

           

           

          We think of two solutions for this issue:

          - at startup first, delete all the datasources from JBoss using the Management API, then create them again based on the application configuration

          Instead of that, why not check the "presence" of your datasource using the Management API and if it's present, then skip the creation part.

           

           

          frankie007 wrote:

           

          - don't persist the changes made by the Management API

           

          No that's not possible.

          • 2. Re: Configuring with management API without persisting changes in configuration xml
            frankie007

            Thanks for your reply Jaikiran.

             

            I'm afraid that this would not solve our problem.

            We have to assume that while the application/server is down the configuration file of the application can be altered.

            At startup of the server this assumption would force us to first delete all the datasources (and other configured components) and then recreate them based on the settings in the application configuration.

            This is such a tremendous overhead and would significantly slow down the lightning boot speed of our Jboss server that we are hoping there is an alternative. Has anyone an idea on how to solve this?

             

            What is it the design reason to not have the option to reflect the configuration changes only in the runtime?

             

            Thanks a lot.