A message flow can be configured at node level to emit monitoring events. A monitoring event is represented as a XML document that conforms to the monitoring event schema. Each event always contains the following information:
You can configure a message flow to emit two types of events: Transaction events and terminal events.
There are three types of transaction events: start, end, and rollback. The transaction events are emitted only from input nodes such as MQInput and HTTPInput.
Terminal events are emitted from any terminal of any node.
Event output :
The monitoring event feature leverages the publish/subscribe (pub/sub) mechanism of Message Broker. Event messages are published to the specific topics, which can be registered by subscribing applications. The form of the topic name is: $SYS/Broker/<brokerName>/Monitoring/<executionGroupName>/<flowName>
We can subscribe to these event by following ways :
Using rfhutil tool
Here
Broker Name : MYBROK
Execution Group Name : MYEG
Flow Name : MYFLOW
Subscription Queue Name : SUB.EVENT
Using a Message Flow :
This can be done by posting a subscription request to SYSTEM.BROKER.CONTROL.QUEUE queue.
Following is the esql code to create subscription request :
BEGIN
CALL CopyEntireMessage();
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.Topic = '$SYS/Broker/MYBRK/Monitoring/MYEG/MYFLOW';
SET OutputRoot.MQRFH2.psc.QName = 'SUB.EVENT';
SET OutputRoot.MQRFH2.psc.QMgrName = 'QM';
DECLARE ptr REFERENCE TO OutputRoot.MQRFH2;
DETACH ptr;
ATTACH ptr TO OutputRoot.MQMD AS NEXTSIBLING;
RETURN TRUE;
mqsichangeflowmonitoring MYBRK -e MYEG -f MYFlow -s "Event_Src_address1,"Event_Src_address2" -i enable/disable
Activating/Inactivating the events :
mqsichangeflowmonitoring MYBRK -e MYEG -f MYFlow -c active/inactive
To report what are all event sources has been activated :
mqsireportflowmonitoring MYBRK -e MYEG -f MYFlow -a
Monitoring in IIB
- Source of the event (eventSourceAddress)
- Name of the event (eventName)
- Creation time (creationTime)
- Correlation ID for events emitted by the same transaction or unit of work (localTransactionId,parentTransactionId, and globalTransactionId)
- Details of the message flow (messageFlowData)
- Application data extracted from the message (applicationData)
- Part or all of the message bit stream (bitstream)
Event types :
You can configure a message flow to emit two types of events: Transaction events and terminal events.
There are three types of transaction events: start, end, and rollback. The transaction events are emitted only from input nodes such as MQInput and HTTPInput.
Terminal events are emitted from any terminal of any node.
Event output :
The monitoring event feature leverages the publish/subscribe (pub/sub) mechanism of Message Broker. Event messages are published to the specific topics, which can be registered by subscribing applications. The form of the topic name is: $SYS/Broker/<brokerName>/Monitoring/<executionGroupName>/<flowName>
We can subscribe to these event by following ways :
Using rfhutil tool
Here
Broker Name : MYBROK
Execution Group Name : MYEG
Flow Name : MYFLOW
Subscription Queue Name : SUB.EVENT
Using a Message Flow :
This can be done by posting a subscription request to SYSTEM.BROKER.CONTROL.QUEUE queue.
Following is the esql code to create subscription request :
BEGIN
CALL CopyEntireMessage();
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.Topic = '$SYS/Broker/MYBRK/Monitoring/MYEG/MYFLOW';
SET OutputRoot.MQRFH2.psc.QName = 'SUB.EVENT';
SET OutputRoot.MQRFH2.psc.QMgrName = 'QM';
DECLARE ptr REFERENCE TO OutputRoot.MQRFH2;
DETACH ptr;
ATTACH ptr TO OutputRoot.MQMD AS NEXTSIBLING;
RETURN TRUE;
Enabling/Disabling the event sources :
By default, all of the configured events in a message flow are enabled but we have to activate the events. We can enable or disable these events by issuing following commandmqsichangeflowmonitoring MYBRK -e MYEG -f MYFlow -s "Event_Src_address1,"Event_Src_address2" -i enable/disable
Activating/Inactivating the events :
mqsichangeflowmonitoring MYBRK -e MYEG -f MYFlow -c active/inactive
To report what are all event sources has been activated :
mqsireportflowmonitoring MYBRK -e MYEG -f MYFlow -a
Monitoring in IIB
Thanks for your explanation.
ReplyDeleteMy question here is, after configuring this where can I find the XML with the information of the Events?
Thanks you in Advice.
Hi,
ReplyDeleteAs you have subscribed to the event, you will get event message in the subscription queue.
i.e, in this case SUB.EVENT queue.
good
ReplyDeleteCan you explain what this code is doing "DECLARE ptr REFERENCE TO OutputRoot.MQRFH2;
ReplyDeleteDETACH ptr;
ATTACH ptr TO OutputRoot.MQMD AS NEXTSIBLING;"