8 Replies Latest reply: Mar 10, 2012 5:39 PM by Enguerrand Dibanda RSS

Server Group properties

Noel Rocher Newbie

Hi,

I'm using AS7.1 Final

In my HA profile, I've defined a property for the name of the file to use instead of server.log 

 

<file relative-to="jboss.server.log.dir" path="${noel.test}.log"/>

I'm now defining a value for this property in my server group

<server-group name="test" profile="ha">

            <socket-binding-group ref="mySockets"/>

            <system-properties>

                <property name="jboss.default.multicast.address" value="230.0.0.10"/>

                <property name="noel.test" value="serverTest"/>

            </system-properties>

</server-group>

I was expecting that each server in the group will use serverTest.log to log information but ${noel.test}.log file is created instead.

Am I misunderstanding what group system properties are useful for?

  • 1. Re: Server Group properties
    Brian Stansberry Master

    Not every attribute in the configuration supports system property expressions. The log file path doesn't. The :read-resource-description operation for the resource will include "expressions-allowed" => true for any attribute that does.

  • 2. Re: Server Group properties
    Enguerrand Dibanda Newbie

    Hello Brian,

     

    could you please give an example CLI command for checking if an attribute supports expressions?

     

    thx

  • 3. Re: Server Group properties
    Brian Stansberry Master

    Sure

    [standalone@localhost:9999 /] cd socket-binding-group=standard-sockets/socket-binding=http

    [standalone@localhost:9999 socket-binding=http] :read-resource-description

    {

        "outcome" => "success",

        "result" => {

            "description" => "Configuration information for a socket.",

            "attributes" => {

                "port" => {

                    "type" => INT,

                    "description" => "Number of the port to which the socket should be bound.",

                    "expressions-allowed" => true,

                    "nillable" => false,

                    "min" => 0L,

                    "max" => 65535L,

                    "access-type" => "read-write",

                    "storage" => "configuration",

                    "restart-required" => "all-services"

                },

                "bound-port" => {

                    "type" => INT,

                    "description" => "The port to which the actual socket using this socket binding configuration has been bound, or undefined if no socket has been bound.",

                    "expressions-allowed" => false,

                    "nillable" => true,

                    "min" => 1L,

                    "max" => 2147483647L,

                    "access-type" => "metric",

                    "storage" => "runtime"

                },

                "interface" => {

                    "type" => STRING,

                    "description" => "Name of the interface to which the socket should be bound, or, for multicast sockets, the interface on which it should listen. This should be one of the declared interfaces.",

                    "expressions-allowed" => true,

                    "nillable" => true,

                    "min-length" => 1L,

                    "max-length" => 2147483647L,

                    "access-type" => "read-write",

                    "storage" => "configuration",

                    "restart-required" => "all-services"

                },

                "fixed-port" => {

                    "type" => BOOLEAN,

                    "description" => "Whether the port value should remain fixed even if numeric offsets are applied to the other sockets in the socket group.",

                    "expressions-allowed" => true,

                    "nillable" => true,

                    "default" => false,

                    "access-type" => "read-write",

                    "storage" => "configuration",

                    "restart-required" => "no-services"

                },

                "client-mappings" => {

                    "type" => LIST,

                    "description" => "Specifies zero or more client mappings for this socket binding. A client connecting to this socket should use the destination address specified in the mapping that matches its desired outbound interface. This allows for advanced network topologies that use either network address translation, or have bindings on multiple network interfaces to function. Each mapping should be evaluated in declared order, with the first successful match used to determine the destination.",

                    "expressions-allowed" => false,

                    "nillable" => true,

                    "value-type" => {

                        "source-network" => {

                            "description" => "Source network the client connection binds on. This value is in the form of ip/netmask. A client should match this value against the desired client host network interface, and if matched the client should connect to the corresponding destination values. If omitted this mapping should match any interface.",

                            "type" => STRING,

                            "nillable" => true,

                            "min-length" => 1

                        },

                        "destination-address" => {

                            "description" => "The destination address that a client should connect to if the source-network matches. This value can either be a hostname or an ip address.",

                            "type" => STRING,

                            "nillable" => false,

                            "min-length" => 1

                        },

                        "destination-port" => {

                            "description" => "The destination port that a client should connect to if the source-network matches. If omitted this mapping will reuse the effective socket binding port.",

                            "type" => INT,

                            "nillable" => true,

                            "min" => 0,

                            "max" => 65535

                        }

                    },

                    "access-type" => "read-write",

                    "storage" => "configuration",

                    "restart-required" => "all-services"

                },

                "multicast-port" => {

                    "type" => INT,

                    "description" => "Port on which the socket should receive multicast traffic. Must be configured if 'multicast-address' is configured.",

                    "expressions-allowed" => true,

                    "nillable" => true,

                    "min" => 1L,

                    "max" => 65535L,

                    "access-type" => "read-write",

                    "storage" => "configuration",

                    "restart-required" => "all-services"

                },

                "bound-address" => {

                    "type" => STRING,

                    "description" => "The address to which the actual socket using this socket binding configuration has been bound, or undefined if no socket has been bound.",

                    "expressions-allowed" => false,

                    "nillable" => true,

                    "min-length" => 1L,

                    "max-length" => 2147483647L,

                    "access-type" => "metric",

                    "storage" => "runtime"

                },

                "name" => {

                    "type" => STRING,

                    "description" => "The name of the socket. Services which need to access the socket configuration information will find it using this name.",

                    "expressions-allowed" => false,

                    "nillable" => false,

                    "min-length" => 1L,

                    "max-length" => 2147483647L,

                    "access-type" => "read-only",

                    "storage" => "configuration"

                },

                "multicast-address" => {

                    "type" => STRING,

                    "description" => "Multicast address on which the socket should receive multicast traffic. If unspecified, the socket will not be configured to receive multicast.",

                    "expressions-allowed" => true,

                    "nillable" => true,

                    "min-length" => 1L,

                    "max-length" => 2147483647L,

                    "access-type" => "read-write",

                    "storage" => "configuration",

                    "restart-required" => "all-services"

                },

                "bound" => {

                    "type" => BOOLEAN,

                    "description" => "Whether an actual socket using this socket binding configuration has been bound.",

                    "expressions-allowed" => false,

                    "nillable" => true,

                    "access-type" => "metric",

                    "storage" => "runtime"

                }

            },

            "operations" => undefined,

            "children" => {}

        }

    }

     

    The output includes the description of every attribute on the socket-binding=http resource. Some have "expressions-allowed" => false, others have "expressions-allowed" => true.

     

    See https://docs.jboss.org/author/display/AS71/Description+of+the+Management+Model for full details of this output.

  • 4. Re: Server Group properties
    Enguerrand Dibanda Newbie

    How about resources that don't have "expressions-allowed" in the description of any of their attributes?

     

     

    [standalone@localhost:9999 /] /subsystem=mail/mail-session=java\:jboss\/mail\/Default:read-resource-description 
    {
        "outcome" => "success",
        "result" => {
            "description" => "Mail session configuration",
            "head-comment-allowed" => true,
            "tail-comment-allowed" => true,
            "attributes" => {
                "jndi-name" => {
                    "description" => "JNDI name to where mail session should be bound",
                    "type" => STRING,
                    "required" => true,
                    "access-type" => "read-only",
                    "storage" => "configuration"
                },
                "debug" => {
                    "description" => "If this is true the MailSessionConfiguration will be set to debug mode",
                    "type" => STRING,
                    "required" => false,
                    "access-type" => "read-only",
                    "storage" => "configuration"
                },
                "smtp-server" => {
                    "description" => "The address of a SMTP Mail Server",
                    "type" => STRING,
                    "required" => false,
                    "access-type" => "read-only",
                    "storage" => "configuration"
                },
                "imap-server" => {
                    "description" => "The address of an IMAP Mail Server",
                    "type" => STRING,
                    "required" => false,
                    "access-type" => "read-only",
                    "storage" => "configuration"
                },
                "pop3-server" => {
                    "description" => "The address of a POP3 Mail Server",
                    "type" => STRING,
                    "required" => false,
                    "access-type" => "read-only",
                    "storage" => "configuration"
                }
            }
        }
    }
    

     

    In your example "expressions-allowed" was always set to "true" or "false". I would have expected it in the attribute description of every resource. Why isn't it the case for the mail config for instance?

     

  • 5. Re: Server Group properties
    Tomaz Cerar Master

    Hi,

     

    looks like you are using some old version of app server.

    here is output i get on 7.1 for mail subsystem:

     

    [standalone@localhost:9999 mail-session=java:jboss/mail/Default] :read-resource-description
    {
        "outcome" => "success",
        "result" => {
            "description" => "Mail session definition",
            "attributes" => {
                "jndi-name" => {
                    "type" => STRING,
                    "description" => "JNDI name to where mail session should be bound",
                    "expressions-allowed" => true,
                    "nillable" => true,
                    "min-length" => 1L,
                    "max-length" => 2147483647L,
                    "access-type" => "read-write",
                    "storage" => "configuration",
                    "restart-required" => "all-services"
                },
                "debug" => {
                    "type" => BOOLEAN,
                    "description" => "Enables javamail debugging",
                    "expressions-allowed" => true,
                    "nillable" => true,
                    "default" => false,
                    "access-type" => "read-write",
                    "storage" => "configuration",
                    "restart-required" => "all-services"
                },
                "from" => {
                    "type" => STRING,
                    "description" => "From address that is used as default from, if not set when sending",
                    "expressions-allowed" => true,
                    "nillable" => true,
                    "min-length" => 1L,
                    "max-length" => 2147483647L,
                    "access-type" => "read-write",
                    "storage" => "configuration",
                    "restart-required" => "all-services"
                }
            },
            "operations" => undefined,
            "children" => {"server" => {
                "description" => "Mail session server",
                "model-description" => undefined
            }}
        }
    }
    

     

     

    --

    tomaz

  • 6. Re: Server Group properties
    Brian Stansberry Master

    Enguerrand Dibanda wrote:

     

    How about resources that don't have "expressions-allowed" in the description of any of their attributes?

     

    If it's not there the default is "false". The details on https://docs.jboss.org/author/display/AS71/Description+of+the+Management+Model discuss the defaults.

  • 7. Re: Server Group properties
    Brian Stansberry Master

    Since 7.0.1 we've been replacing how these descriptions get created. This involves replacing a lot of tedious manual coding of details with generation of the descriptions. The manual coding approach led to a lot of reliance on the defaults described in that docs page. The generated descriptions do not. This effort is ongoing.