Use a global parameter to pass the same value to expressions in all modules in all
containers running on an instance of StreamBase Server. Set global parameters and their
initial values using the <operator-parameters>
element of the server configuration file.
You can reference module parameters as part or all of an expression in any operator or
adapter in any module running on the server, using the syntax ${param-name}
. Global parameters are initialized at
server start time when the server configuration file is read.
For the majority of use cases, TIBCO recommends using module parameters instead of global parameters. The reasons are:
-
Global parameters can inadvertently set a value for a same-named parameter in another module in a large application, including modules written by other development teams. By contrast, module parameters have scope only in the module in which they are declared.
-
Because the initial values of global parameters are set in the server configuration file, the only way to pass different initial global values to an application is to start it with different configuration files.
-
Global parameters can make a complex application more difficult to debug.
-
In general, global settings are not a recommended paradigm.
Global parameters might be legitimately used in the following circumstances:
-
To make the same value available to all modules in an application without having to pass it from module to module.
-
In high availability design patterns, to guarantee that a secondary module starts with the correct values when it takes over for a downed primary module.
If a module parameter has the same name as a global parameter, the module parameter takes precedence. In general, the values of parameters are resolved with the following order of precedence:
-
Module parameters with values set in Module Reference operators.
-
Module parameters with values set with the
<module-parameters>
element in the configuration file. -
Module parameter default values.
-
Global parameters with values set with the
<operator-parameters>
element in the configuration file.
You can narrow the focus of an <operator-parameter>
element by specifying a qualified path in StreamBase path notation to an individual
operator.