Destroying Client Groups
The BrokerAdminClient.destroyClientGroup method allows your applications to destroy a client group defined for a particular Broker. If any existing Broker clients belong to the group, a BrokerDependencyException exception will be thrown and the client group will not be destroyed.
You can use the BrokerAdminClient.getClientIdsByClientGroup method to obtain a list of any Broker clients currently belonging to a group.
The following example illustrates how to destroy a client group for a Broker:
. . .
BrokerAdminClient c;
try {
/* Create a Broker admin client */
c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, "My Broker Monitor",null);
/* Destroy a client group and any current clients, too. */
c.destroyClientGroup(“myGroup”, true);
} catch (BrokerException ex) {
System.out.println("Error while destroying client group\n"+ex);
return;
}
. . .