Monitor the IBM MQ Bridge to Salesforce
We can use the amqsrua sample C program to subscribe to topics and display publications for queue managers that are used by the IBM MQ Bridge to Salesforce.
About this task
At queue manager startup, the queue manager publishes a set of messages about itself to system topics under the metadata prefix $SYS/MQ/INFO/QMGR. The messages indicate what performance data is available for queue managers. Administrative tools can subscribe to topics to discover which resource usage information is available so that they can consume the resource usage data. See Monitor system resource usage by using the amqsrua command for more information.By default, the amqsrua program looks for statistics that are published by the queue manager under the topic tree $SYS/MQ/INFO/QMGR. Other components or applications can use a similar mechanism to publish under a different topic starting point. For example, the IBM MQ Bridge to Salesforce that is available on x86-64 Linux platforms, publishes statistics under $SYS/Application/runmqsfb.
We can use the -p parameter to specify where amqsrua looks for the statistics for these other components on both Linux and Windows.
We can run the command with just the queue manager name and interactively step through to choose the CLASS, then TYPE and then object parameters that are available for the queue manager at each step. If you know the CLASS, TYPE and object names for which we want to see information, we can specify them when you run the amqsrua command.
- -m
- Queue manager name. The queue manager must be running. If we do not specify a queue manager name, statistics for the default queue manager are displayed.
- -c
- CLASS name. IBM MQ resource usage publications are associated with a class. The classes represent the top level in the tree of metadata that describes the available resource usage information.We can use the CHANNEL and STATUS classes only to see publications that are received for queue managers that are used with the IBM MQ Bridge to Salesforce. We must specify the -p parameter with the metadata prefix "\$SYS/Application/runmqsfb" when you run the amqsrua command to see the information for the CHANNEL and STATUS classes.
- STATUS
- Returns information about the status of the IBM MQ Bridge to Salesforce.
- CHANNEL
- Returns information about Salesforce events.
- -t
- TYPE name. IBM MQ resource usage publications are associated with a type within a class. Each publication includes the class and type that allows the class/type/element definitions to be found and the resulting publications to be handled. The class/type/element descriptions are published as metadata at queue manager startup.
The STATUS and CHANNEL classes are available when you run the amqsrua program for a queue manager that is used with the IBM MQ Bridge to Salesforce.
For the STATUS class.
- PUSHTOPIC
- Salesforce push topics.
- EVENTS
- Salesforce platform events.
- MQPE
- With this option, we can see information for IBM MQ created platform events. When you select this option, the following data is shown:
- Total number of IBM MQ created platform events that are processed in an interval (under the STATUS/MQPE tree).
- Unique number of IBM MQ created platform events that are seen in this interval.
- Failed number of publications of IBM MQ created platform events that are seen in this interval.
For the CHANNEL class.
- EVENTS
- Total number of publications for a specific Salesforce push topic or platform event. We need to specify the object name for class(CHANNEL) type(EVENTS), for example /topic/push_topic_name or /event/platform_event_name.
- -o
- Object name. Resource usage publications are PCF messages that consist of a sequence of PCF elements. The PCF elements that are published for each class/type pair are advertised in the metadata. A leaf is stored in the tree that describes each element, thus allowing the elements to be processed.
- -p
- Metadata prefix. Specify a topic tree starting point where amqsrua can look for statistics that are published by queue managers. The default topic tree is $SYS/MQ/INFO/QMGR but other components or applications might publish statistics under a different topic tree starting point, for example, the IBM MQ Bridge to Salesforce publishes statistics under $SYS/Application/runmqsfb.
- -n
- Publication count. We can specify how many reports are returned before the command ends. The data is published approximately every ten seconds, so if you enter a value of 50, the command returns 50 reports over 500 seconds. If we do not specify this parameter, the command runs until either an error occurs, or the queue manager shuts down.
- -h
- Usage
Procedure
- Change to the samples directory MQ_INSTALLATION_PATH/samp/bin.
- Issue the amqsrua command with the -p parameter to point to the topic "\$SYS/Application/runmqsfb" where the queue manager publishes IBM MQ Bridge to Salesforce push topic and platform event monitoring information:
./amqsrua -m QM1 -p "\$SYS/Application/runmqsfb"STATUS : Bridge Status CHANNEL : Salesforce Event Name Enter Class selection ==>- Enter the class selection CHANNEL
==> CHANNELSTATUS : Bridge Status CHANNEL : Salesforce Event Name Enter Class selection ==> CHANNEL EVENTS : Events Enter Type selection ==>- Enter the type selection EVENTS
==> EVENTSSTATUS : Bridge Status CHANNEL : Salesforce Event Name Enter Class selection ==> CHANNEL EVENTS : Events Enter Type selection ==> EVENTS An object name is required for Class(CHANNEL) Type(EVENTS) Enter object name ==>- Enter the object name, for example
==> /topic/push_topic_nameSTATUS : Bridge Status CHANNEL : Salesforce Event Name Enter Class selection ==> CHANNEL EVENTS : Events Enter Type selection ==> EVENTS An object name is required for Class(CHANNEL) Type(EVENTS) Enter object name ==> /topic/push_topic_name Publication received PutDate:20170215 PutTime:14513762 Interval:15.047 seconds Total Events 1
Results
We have used the amqsrua program interactively, by entering the class, type and object options in order to see the total number of events for the specified push topic.In this example, we can use the amqsrua to check the number of Salesforce push topics:./amqsrua -m QM1 -p "\$SYS/Application/runmqsfb" STATUS : Bridge Status CHANNEL : Salesforce Event Name Enter Class selection ==> STATUS PUSHTOPIC : Push Topics EVENTS : Platform Events Enter Type selection ==> PUSHTOPIC Publication received PutDate:20170315 PutTime:10123086 Interval:15.016 seconds Total PushTopics 6 Unique PushTopics 3 Publication received PutDate:20170315 PutTime:10124588 Interval:15.012 seconds Total PushTopics 14 1/sec Unique PushTopics 7In this example, we can use the amqsrua to check the number of IBM MQ created platform events:./amqsrua -m QM1 -p "\$SYS/Application/runmqsfb" STATUS : Bridge Status CHANNEL : Salesforce Event Name Enter Class selection ==> STATUS PUSHTOPIC : Pushtopics EVENTS : Platform Events MQPE : MQ-created Platform Events Enter Type selection ==> MQPE Publication received PutDate:20170913 PutTime:12201271 Interval:15.018 seconds Total MQ-created Platform Events 1 Unique MQ-created Platform Events 1 Failed publications of MQ-created Platform Events 0Parent topic: Monitor the IBM MQ network
Related tasks
Related information
- Configure IBM MQ for use with Salesforce push topics and platform events
- runmqsfb (run IBM MQ Bridge to Salesforce)
- Preparing and running sample programs on Windows
- Preparing and running sample programs on UNIX and Linux