Accessing broker attributes from the JavaCompute node

For each broker, WebSphere Message Broker maintains a set of attributes. You can access some of these attributes from your Java programs. It can be useful, during the run time of your code, to have real-time access to details of a specific node, flow, or broker.

There are four categories of broker attribute:
  • Those relating to a specific node
  • Those relating to nodes in general
  • Those relating to a message flow
  • Those relating to the execution group

The List of broker properties accessible from ESQL and Java shows the broker, flow, and node attributes that are accessible from Java. The table also indicates whether the attributes are accessible from ESQL.

Broker attributes:
  • Are case sensitive. Their names always start with an uppercase letter.
  • Are grouped by broker, flow, execution group, and node. See Table 1.
To access broker attributes in a JavaCompute node, call methods on the following classes:
  • MbBroker
  • MbExecutionGroup
  • MbMessageFlow
  • MbNode
For example:
String brokerName = getBroker().getName();

Table 1 shows the broker, flow, and node attributes that are accessible from Java and ESQL.

Related concepts
User-defined properties
Related tasks
Managing Java Files
Writing Java
Related reference
List of broker properties accessible from ESQL and Java