Using Same Profile but Different Configuration for Different Server Groups: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * WildFly System Properties =Overview=")
 
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:


=Overview=
=Overview=
The fact that we are able to specify different properties (or same properties with different values) for different server groups allows us to use a single profile with multiple server groups, if the differences in configuration between server groups can be expressed as values of system properties. The following example shows how to declare different MDB container pool sizes for servers belonging to two different groups.
=Procedure=
Declare a system property that will carry the value of the MDB pool size. This system property will have different values per server group. It is also possible that the system property may '''not''' be declared for specific server groups, and in this case, the default configuration value, as shown below, will be used.
<pre>
<server-groups>
    <server-group name="A" profile="common">
        <system-properties>
            <property name="our.mdb.max.pool.size" value="1"/>
        </system-properties>
        ...
    </server-group>
    <server-group name="B" profile="common">
        <system-properties>
            <property name="our.mdb.max.pool.size" value="10"/>
        </system-properties>
        ...
    </server-group>
    <server-group name="C" profile="common">
        <!--
            No property declaration here, which means the default value will be used.
        -->
        ...
    </server-group>
</server-groups>
</pre>
Use the system property name, and a default value for the case the system property is missing.
<pre>
<profiles>
    <profile name="common">
        ...
        <subsystem xmlns="urn:jboss:domain:ejb3:...">
            ...
            <pools>
                <bean-instance-pools>
                    <strict-max-pool name="mdb-strict-max-pool"
                                    max-pool-size="${our.mdb.max.pool.size:20}" .../>
                </bean-instance-pools>
            </pools>
            ...
        </subsystem>
    </profile>
</pre>

Latest revision as of 15:49, 29 March 2017

Internal

Overview

The fact that we are able to specify different properties (or same properties with different values) for different server groups allows us to use a single profile with multiple server groups, if the differences in configuration between server groups can be expressed as values of system properties. The following example shows how to declare different MDB container pool sizes for servers belonging to two different groups.

Procedure

Declare a system property that will carry the value of the MDB pool size. This system property will have different values per server group. It is also possible that the system property may not be declared for specific server groups, and in this case, the default configuration value, as shown below, will be used.

<server-groups>
    <server-group name="A" profile="common">
        <system-properties>
            <property name="our.mdb.max.pool.size" value="1"/>
        </system-properties>
        ...
    </server-group>
    <server-group name="B" profile="common">
        <system-properties>
            <property name="our.mdb.max.pool.size" value="10"/>
        </system-properties>
        ...
    </server-group>
    <server-group name="C" profile="common">
        <!--
            No property declaration here, which means the default value will be used.
        -->
        ...
    </server-group>
</server-groups>

Use the system property name, and a default value for the case the system property is missing.

<profiles>
    <profile name="common">
        ...
        <subsystem xmlns="urn:jboss:domain:ejb3:...">
            ...
            <pools>
                <bean-instance-pools>
                    <strict-max-pool name="mdb-strict-max-pool" 
                                     max-pool-size="${our.mdb.max.pool.size:20}" .../>
                </bean-instance-pools>
            </pools>
            ...
        </subsystem>
    </profile>