Broker 10.15 | webMethods Broker Documentation | webMethods Broker Administration Java API Programmer’s Guide | Managing Brokers and Broker Servers | Managing Brokers | Creating and Destroying Brokers
 
Creating and Destroying Brokers
You can use the BrokerServerClient.createBrokermethod to create a Broker in the Broker Server to which your BrokerServerClient is connected. You must supply the Broker's name and description. You may also specify that the Broker you are creating should be the default Broker. Your client must have administrative permission to with Broker Server.
The following example illustrates how to create a Broker:
. . .
BrokerServerClient c;
try {
/* Create a Broker Server client */
c = new BrokerServerClient(broker_host, null);
 
/* Create a Broker and make it the default */
c.createBroker( "My Broker", "This is my Broker", true);
...
} catch (BrokerException ex) {
System.out.println("Error creating Broker\n"+ex);
return;
}
. . .
You can use the BrokerServerClient.destroy method to destroy a BrokerServerClient object. The BrokerServerClient will be disconnected from the Broker Server.