Accessing broker properties from ESQL

It can be useful, during the runtime of your code, to have realtime access to details of a specific node, flow, or broker. For an overview of broker properties, see Broker properties.

You can use broker properties on the right-hand side of regular SET statements. For example:
DECLARE mybroker CHARACTER;
SET mybroker = BrokerName;
where BrokerName is the broker attribute that contains the broker's name. However, you cannot use broker properties on the left-hand side of SET statements. This is because, at runtime, broker properties are constants: they cannot be assigned to, and so their values cannot be changed by SET statements. If a program tries to change the value of a broker attribute, the error message Cannot assign to a symbolic constant is issued.
Remember that broker properties:
  • Are case sensitive. Their names always start with an uppercase letter.
  • That do not contain a value return NULL.
  • Are grouped by Broker, Flow, and Node. See Table 1.

If your ESQL code already contains a variable with the same name as one of the broker properties, your variable takes precedence; that is, your variable masks the broker attribute. To access the broker attribute, use the form SQL.<broker_attribute_name>. For example: SQL.BrokerName.

Table 1 shows the broker, flow, and node properties that are accessible from ESQL. The table's fourth column indicates whether the properties are also accessible from Java.

Related concepts
Broker properties
Related reference
List of broker properties accessible from ESQL and Java