Event Monitoring in Message Broker
1. OVERVIEW:
1.1
INTRODUCTION :
Ø Event monitoring is feature which lets
you configure a message flow to emit monitoring events without any coding. As
the configured events occur in the message flow, XML documents are generated
and published as pre-defined topics by the broker on which the message flow is
deployed.
1.2 PURPOSE
OF EVENT MONITORING:
Ø
Message
flows can be configured to emit events. The events can be read and used by
other applications for transaction monitoring, transaction auditing, and
business process monitoring.
Ø
An
event is a message that a message flow publishes when something interesting or
desired happens.
Ø
The
message contains information about the source of the event, the time of the
event, and the reason for the event. The event can include the message bit
stream, and can also include selected elements from the message body. These
fields can be used to convey business
data to a monitoring application.
2. SYSYTEM REQUIREMENTS:
COMPONENTS
|
VERSIONS
|
Websphere MQ Explorer
|
Websphere MQ Explorer V6.1 or later
|
Websphere Message Broker components
|
Websphere Message Broker V6.1.0.3 or later
|
3 PRE REQUISITES:
3.1 CONCEPTS :
The
concepts that we need to know
Ø
Publish/subscribe.
Ø
Monitoring
Events:- A monitoring event is an XML document that conforms to the monitoring
event schema. Each event contains source
of the event ,name of the event ,sequence number and creation time ,correlation
id for events emitted by the same transaction or unit of work ,application data
extracted from the message .
Ø
Types
of Events.
Ø
Transaction
Events:Transaction events are emitted only from input nodes.
Ø
Transaction
start :The event is emitted when the message is read from the transport.
Ø
Transaction
end :The event is emitted when WebSphere Message Broker has completed all
processing of the message.
Ø
Transaction
rollback :The event is emitted instead of transaction end if the message flow
throws an exception which is not caught and processed within the message flow.
Ø
Terminal
Events:Terminal events are emitted from any terminal of any node, including
input nodes(Failure,Catch,Out).
4.FUNCTIONALITY
AND SCENARIO:
4.1 ILLUSTRATION:
4.1.1 CONFIGURING
A MESSAGE FLOW TO GENERATE MONITORING EVENTS
Ø
We
can configure monitoring events to emit without any coding as follows:
Ø
In
the node properties we can find a property called monitoring, which needs to be
set inorder to emit an event.
Ø
We
need to select event source, event name and the event pay load .
Ø
Event
Payload is where we will be writing an X-path expression , whose value needs to
be extracted from the message.
Ø
As
the event occurs an XML document is generated and published in a predefined
topic by the broker in the flow is deployed.
4.1.2 COMMAND FOR ACTIVATING THE
EVENTS:
Ø
command to activate:
mqsichangeflowmonitoring
brokername -e executaiongroupname -f flowname -c active
Ø
Use
-c
inactive to
inactivate.
Ø
Status
for monitoring:
mqsireportflowmonitoring brokername -e
executaiongroupname -f flowname -a
4.1.3 SUBSCRIBING AND RETRIVING
THE MESSAGE:
Ø
As
the event message is generated and published in the topic , we need to
subscribe it to retrive the event message.
Ø
This
subscription can be done by directly subscribing from the MQ or through a
subscription flow.
4.1.4 Topics:
Ø
The
format of the topic string is
$SYS/Broker/<BrokerName>/Monitoring/<ExecutionGroupName>/<MessageFlowName>
Ø Topic string for a
specfic message flow and specific execution group is
$SYS/Broker/BRK1/Monitoring/default/MonitoringEvents_MF
Ø Topic string for
allmessage flow among all execution group is
$SYS/Broker/BRK1/Monitoring/#/#.
Where # is a wild card indicating all .
4.1.5 FLOWS ACROSS DIFFERENT
BROKERS:
Ø By using distribution
queueing we can place the event messages of
all flows across different brokers.
Ø For instance if we have
two brokers say brk1 and brk2 .
Ø We need to place all
the event messages of all the flows from two brokers in a
queue of brk1.
Ø Hence queue's from
different brokers queue manager will subscribe indvidually and then we need to
create a distribution queueing between two queue managers.
4.2
EXECUTION:
4.2.1 CONFIGURING A MESSAGE FLOW TO
GENERATE MONITORING EVENTS:
Ø selcet monitoring
property and click on add.
Ø
select
the basic tab ,set event source,event name, select event payload and click add
to add an X-path expression .
Ø
Adding
an X path expression in event payload
Ø
Different kinds of expressions.
4.2.2 COMMAND FOR ACTIVATING THE EVENTS:
Command for activating :
Ø
"mqsichangeflowmonitoring brokername -e ExecutionGroupname
-f Flowname -c active"
Command
for status:
Ø
“mqsireportflowmonitoring brokername -e
executiongroupname -f flowname –a”
Ø
4.2.3 SUBSCRIBING THE TOPIC:
Ø
select
the subscription object in the queue manager.
Ø
Select
new and subscription
Ø
Now
we give topic string and queue name to which needs to be subscribed .
Ø
Topic
string for a specific flow and execution group.
Ø
Topic
string for all flows across all execution group.
Ø
Event
message :
Ø
Where
the XML message consists of broker name, execution group name , flow name and
the MsId which is extracted from the message.
Ø
This
message is produced when then third property of the event pay load is ocured .
Ø
The
value will be true when the condition is meet, else it will be false.
No comments:
Post a Comment