HPSEARCH_HOME/bin/runBrokerInstantiatorService.(bat/sh) to start the service frontend on the
machines where the service needs to run.
API
NB_HOME/configBrokerConfiguration.txt file is used. Secvice Confguration file is required for some
newer features in NB. If not specified the default NB_HOME/config/ServiceConfiguration.txt is used
x = new NaradaBroker("http://156.56.104.139:17070/");
brokId = x.create("C:\\Home\\NaradaBrokering-0.99-rc4\\config\\Broker-II-Configuration.txt",
"C:\\Home\\NaradaBrokering-0.99-rc4\\config\\ServiceConfiguration.txt");
brokerId - Identifies the source broker from where the connection is to be initiatedhost - Host on which the destination broker to connnect to is runningport - Port on which the destination broker to connnect to is listeningprotocol - Protocol to use. NB supports t (TCP), U(udp), ptcp(Parallel TCP), niotcp(Non Blocking IO TCP) etc...
Complete list may be found on NB web-site.
alternateConfig - Use an alternate configuration file. Ususally pass an empty stringlink = x.connectTo(brokId, "156.56.104.139", "5045", "t", "");
brokerId - Identifies the source brokerlinkID - specifies the link (E.g. one obtained from connectTo)linkLevel - specifies if this broker is a cluster, super-cluster etc.
if(x.requestNodeAddress(brokId, link, "0")) {
Sys.print("OK");
} else {
Sys.print("OOPS...");
}
brokerId - Identifies the source brokerlinkID - specifies the link (E.g. one obtained from connectTo)linkLevel - specifies if this broker is a cluster, super-cluster etc.
if(x.requestGatewayAddress(brokId, link, "0")) {
Sys.print("OK");
} else {
Sys.print("OOPS...");
}
brokerId - Identifies a brokerlinks = x.getLinks(brokId);
brokerId - Identifies a brokerlinkID - specifies the link (E.g. one obtained from connectTo)x.removeLink(brokId, links[0]);
brokers = x.getBrokers();
x.killBroker("uuid:12345678-1234-1234-1234-123456789012");
NOTE: The above commands work only for brokers created with HPSearch's BrokerInstantiatorService
LINKS: