Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# 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:

- Consumes it
- Reports it and then consumes it
- Repairs it and then resends it

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);
       }
    }

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.