WebMethods - Get Broker client group stats in Java
by
Jeremy Canfield |
Updated: February 09 2023
| WebMethods articles
This assumes you are able to connect to WebMethods Broker Server in Java.
Here is an example class that can be used to get the Broker client group statistics for the Broker clients on server1.example.com.
import COM.activesw.api.client.*;
public class Main {
public static void main(String[] args) {
try {
BrokerAdminClient admin_client = new BrokerAdminClient("server1.example.com", null, null, "admin", "WebMethods Admin Client", null);
System.out.println(admin_client);
String[] getClientGroupNames = admin_client.getClientGroupNames();
for (String group : getClientGroupNames) {
System.out.println("group = " + group);
BrokerEvent getClientGroupStats = admin_client.getClientGroupStats(group);
System.out.println(getClientGroupStats);
}
} catch (BrokerException ex) {
System.out.println("Caught the following exception: " + ex);
}
}
}
If the request is successful, something like this should be returned.
BrokerServerClient:
broker_host=server1.example.com
broker_port=6849
group = IntegrationServer
event stats {
date now = "02/08/2023 23:59:06.374";
date createTime = "03/26/2015 16:49:36";
date updateTime = "03/15/2018 12:26:14";
int numEventsPublished = 828671;
int numEventsDelivered = 174255;
date lastEventPublishTime = "05/10/2022 14:08:11";
date lastEventDeliveryTime = "02/17/2021 14:19:10";
};
group = analysis
event stats {
date now = "02/08/2023 23:59:06.418";
date createTime = "03/26/2015 16:49:36";
date updateTime = "03/15/2018 09:40:01";
int numEventsPublished = 2475504;
int numEventsDelivered = 224930422;
date lastEventPublishTime = "02/08/2023 23:49:07";
date lastEventDeliveryTime = "02/08/2023 23:59:06";
};
Did you find this article helpful?
If so, consider buying me a coffee over at