1 Reply Latest reply on Jan 28, 2008 12:43 PM by Brian Stansberry

    Retaining the option to cluster or not

    Simon Heap Newbie


      I guess I know the answer to this, but anyway ...

      We've got an application that includes stateless EJB3 session beans. To date, we've developed and tested against a single JBoss AS. I now want to convert our application to run against a clustered JBoss AS. The recommended approach is to annotate our SSBs with @Clustered. But I need to retain the option to run in a non-clustered environment. Do I have to go the XML configuration route to allow me that flexibility? Any other suggestions?


        • 1. Re: Retaining the option to cluster or not
          Brian Stansberry Master

          You know the answer. ;-)

          You need to use XML. Use system property substition to make it externally configurable:


          Then, to turn off clustering for the 'default' config

          ./run.sh -Dcom.foo.clustered=false

          If you use the annotation, the container will see it and try to add clustering behavior. In the absence of the needed support services this will fail the deployment.