Hello,
I am trying to get document names from a particular client queue using Java BrokerClient API.
I’m using the getEvents method to achieve the same.
My reason for choosing this approach has been discussed in this thread Retrieving documents from Dead Letter Queue - webMethods - Software AG Tech Community & Forums
I have a client named gclient32-2 which has 1000 docs in its queue
Now, here’s my code:
public static final void getEventFrequencies(IData pipeline)
throws ServiceException {
//Initializing parameters
String broker_host = “localhost:6849”;
String broker_name = null;
String client_group = “eventLog”;
BrokerClient c;
String client_id=“#gclient32-2”;
…
…
try {
//Connecting to the client
c = BrokerClient.reconnect(broker_host, broker_name, client_id,null);
…
…
BrokerEvent s;
//Loop over 8 times
// getEvents retrieves maximum of 160 events at a time
while(count < 8 ) {
[b] s = c.getEvents(160, -1);[/b]
count+=1;
......
[b]//To get the document names[/b]
for (BrokerEvent str : s) {
doc_names = str.getTypeName();
.......
}
The getEvents method is retrieving only 70+ or 80+ (sometimes only 30+) in one iteration. I was able to get about 450 docs (getEvents in a loop for 8 times). Again, this number varies every time I run. I have also tried various combinations of parameters for this method. What am I missing ?
What is the reason for this inconsistent behaviour ? How do I proceed to get all document names ?
Any leads are appreciated.