Thanks a ton!
It worked.
Here’s my code. I am hardcoding the client ID now. But I guess I have to find a way to dynamically get it (by writing to file maybe).
===CODE====
public static final void onemore(IData pipeline) throws ServiceException {
String broker_host = “localhost:6849”;
String broker_name = null;
String client_group = “eventLog”;
BrokerClient c;
String client_id;
client_id =“#gclient21-3”;
//id= c.getClientId();
try {
c = BrokerClient.reconnect(broker_host, broker_name,
client_id, null);
com.wm.util.JournalLogger.log(3,90,3,"Client working"+ client_id );
try {
BrokerEvent[] s= new BrokerEvent[10];
s= c.getEvents(10,-1);
for(BrokerEvent str: s){
com.wm.util.JournalLogger.log(3,90,3,"Event Types :" + str.getBaseTypeName());
}
com.wm.util.JournalLogger.log(3,90,3,"Length of te Queue: " + c.getQueueLength());
}catch(BrokerException ex){
com.wm.util.JournalLogger.log(3,90,3,"Catch Block: Couldn't Print Queue: " + ex);
//com.wm.util.JournalLogger.log(3,90,3,"EventBrowse Try Block" + s.length);
}
try {
c.disconnect();
} catch (BrokerException ex) {
com.wm.util.JournalLogger.log(3,90,3,"Catch block disconnect"+ex);
}
}
catch (BrokerException ex) {
com.wm.util.JournalLogger.log(3,90,3,"Client ID not working"+ ex);
}
}
#Universal-Messaging-Broker#webMethods#Integration-Server-and-ESB#broker