Lock Failures

Instead of throwing an exception after failing to acquire a lock after a few attempts, re-route the event to a special destination that only handles errors (an "error queue"), so you have control over which queue the message goes to.

Write a preprocessor on the “error queue” that does do one of the following for each message:

For example:

System.debugOut("Attempting to lock..");
boolean result = false;
for(int i = 1; i <= 3; i = i + 1){
   result = Cluster.DataGrid.Lock("$lock0", 2000, false);
   if(result == false){
      System.debugOut("Lock acquisition '$lock0' failed. Attempts: " + i);
   }
   else{
      System.debugOut("Lock acquisition '$lock0' succeeded. Attempts: " + i);
      break;
   }
}
if(result == false){
   Event.consumeEvent(newevent);
   Event.routeTo(newevent, "/Channel/LockErrorDestination", null);
   }
}