Hi Chris,
as Douglas has already pointed out the following approach is probably the easy way to go: just use one thread with receiceAny(). You might add more threads (but all have to have different userid/token pairs) to support parallel processing.
Receive logic could look like this:
while (true) {
try {
msg = UnitofWork.receiveAny(server, "NO");
u = msg.getUnitofWork();
System.out.println("received: " + u.getUnitofWorkID());
}
catch (BrokerException e) {
if ((e.getErrorClass() == 3 && e.getErrorCode() == 3)
// no matching conversation found
|| (e.getErrorClass() == 74 && e.getErrorCode() == 74)
// Wait timeout occurred
|| (e.getErrorClass() == 74 && e.getErrorCode() == 300)) {
// Conversation found no units of work
System.out.println("No UnitofWork found");
break;
}
else if (e.getErrorClass() == 74 && e.getErrorCode() == 301)
// Conversation found end of unit of work
u.commit();
else {
System.out.println(e);
break;
}
}
}
#Mainframe-Integration#webMethods#EntireX