1 Reply Latest reply on Jan 28, 2008 12:43 PM by brian.stansberry

    Retaining the option to cluster or not

    jusi

      Hi

      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?

      Thanks
      Simon

        • 1. Re: Retaining the option to cluster or not
          brian.stansberry

          You know the answer. ;-)

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

          <clustered>${com.foo.clustered:true}</clustered>
          


          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.