5 Replies Latest reply on Mar 8, 2013 11:37 AM by jmesnil

    Property Replacement in messaging subsystem of AS7/EAP 6.0.1

    mlange

      We are trying to configure different journal directories for server instances managed in domain mode:

       

      domain.xml:

      <journal-directory path="../../integration/${storage.group}/journal" relative-to="user.home" />

       

      <server-group name=....

      <jvm-options>

          <option value="-Dstorage.group=group1"/>

      </jvm-options>

       

      But the property is not replaced neither when set in domain.xml nor when set in host-slave.xml.

       

      The instance is started correctly with the system property set:

      -D[Server:node-one-master] -XX:PermSize=256m -XX:MaxPermSize=256m -Xms512m -Xmx512m -server -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Dstorage.group=group1

       

      But the logs reveal that the it was not replaced:

      [Server:event-node-one-master] 11:24:30,777 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-6) live server is starting with configuration HornetQ Configuration (clustered=true,backup=false,sharedStore=true,journalDirectory=/../../integration/${storage.group}/journal

       

      Is the property replacement supported in messaging subsystem? If not, how can one realize dynamic configurations within the hornetq server?

       

      Thanks,

      Marek

        • 1. Re: Property Replacement in messaging subsystem of AS7/EAP 6.0.1
          ataylor

          Im not sure if its supported tbh. I would ask on the AS7 forums, the subsystem is developed by the AS team not us.

          • 2. Re: Property Replacement in messaging subsystem of AS7/EAP 6.0.1
            jmesnil

            We added extensive expression support in AS7 messaging subsystem[1] only in 7.2.x branch (it's not in EAP 6.0.1 either).

             

            Unfortunately, I don't have a good workaround to offer you if you have to stay on the 7.1.x line...

             

            https://issues.jboss.org/browse/AS7-4917

            1 of 1 people found this helpful
            • 3. Re: Property Replacement in messaging subsystem of AS7/EAP 6.0.1
              mlange

              Hi Jeff,

               

              to clarify your answer: the issue you are referring is only about using expressions in the "path" definitions. So it is possible to use system properties. But what about using <path> definitions (documented in https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-Paths)

               

              <journal-directory path="XYZ" />

              <bindings-directory path="XYZ" />

              <large-messages-directory path="XYZ" />

              <paging-directory path="XYZ" />

               

              I was trying to define the <paths> element globally in domain.xml:

               

              <paths>

                     <path name="storage.bindings" />

                     <path name="storage.journal" />

                     <path name="storage.paging" />

                     <path name="storage.largemessages" />

              </paths>

               

              and referring to these paths in the hornetq-server definition:

               

              <journal-directory path="storage.bindings" />

              <bindings-directory path="storage.journal" />

              <large-messages-directory path="storage.paging" />

              <paging-directory path="storage.largemessages" />

               

              In the host-slave.xml these attributes are defined on a per-server base:

               

              <servers>

                   <server name="event-node-one-master" group="event-infra-server-master-group" auto-start="false">

                       <jvm name="default"></jvm>

                       <paths>

                          <path name="storage.bindings" path="/my/path/to/bindings" relative-to="user.home" />

                          <path name="storage.journal" path="/my/path/to/journal" relative-to="user.home />

                          <path name="storage.paging" path="/my/path/to/paging" relative-to="user.home />

                          <path name="storage.largemessages" path="/my/path/to/large-messages" relative-to="user.home/>

                      </paths>

                  </server>

               

              Domain controller and slaves startup without errors - but the HornetQ configuration looks like this:

               

              [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-3) live server is starting with configuration HornetQ Configuration (clustered=true,backup=false,sharedStore=true,journalDirectory=/home/user/jboss-eap-601/domain/servers/event-node-one-master/data/storage.journal,bindingsDirectory=/home/user/jboss-eap-601/domain/servers/event-node-one-master/data/storage.bindings,largeMessagesDirectory=/home/user/jboss-eap-601/domain/servers/event-node-one-master/data/storage.largemessages,pagingDirectory=/home/user/jboss-eap-601/domain/servers/event-node-one-master/data/storage.paging)

               

              Is this supposed to work in 7.1.3 aka 6.0.1?

               

              Any help on this is much appreciated! Thanks!

               

              Marek

              • 4. Re: Property Replacement in messaging subsystem of AS7/EAP 6.0.1
                mlange

                Seems as if I found a solution for it:

                 

                domain.xml:

                <paths>

                       <path name="storage.bindings.path" />

                       <path name="storage.journal.path" />

                       <path name="storage.paging.path" />

                       <path name="storage.largemessages.path" />

                </paths>

                 

                <journal-directory path="journal" relative-to="storage.journal.path" />

                <bindings-directory path="bindings" relative-to="storage.bindings.path" />

                <large-messages-directory path="large-messages" relative-to="storage.largemessages.path" />

                <paging-directory path="paging" relative-to="storage.paging.path" />

                 

                host-slave.xml:

                <servers>

                       <server name=.....>

                       <paths>

                           <path name="storage.bindings.path" path="/concrete/storage/path" />

                           <path name="storage.journal.path" path="/concrete/storage/path" />

                           <path name="storage.paging.path" path="/concrete/storage/path" />

                           <path name="storage.largemessages.path" path="/concrete/storage/path" />

                         </paths>

                       </server>

                       [...]

                </servers>

                 

                It took me half a day to find it out.

                 

                Thanks anyway!

                Marek

                • 5. Re: Property Replacement in messaging subsystem of AS7/EAP 6.0.1
                  jmesnil

                  I'll add your example to AS7 messaging doc. That'll help a lot of users.

                  It looks cleaner and simpler (once you've figured it out how to configure it ...) than relying on expressions.

                   

                  Thanks!