com.neeve.aep
Enum AepEngine.AppExceptionHandlingPolicy

java.lang.Object
  extended by java.lang.Enum<AepEngine.AppExceptionHandlingPolicy>
      extended by com.neeve.aep.AepEngine.AppExceptionHandlingPolicy
All Implemented Interfaces:
Serializable, Comparable<AepEngine.AppExceptionHandlingPolicy>
Enclosing class:
AepEngine

public static enum AepEngine.AppExceptionHandlingPolicy
extends Enum<AepEngine.AppExceptionHandlingPolicy>

Enumerates an engine's application exception handling policy.

This enumerates the policy using which an engine determines how to handle unchecked exceptions thrown by an application message handler.


Enum Constant Summary
LogExceptionAndContinue
          Log an exception and continue operating.
QuarantineAndStop
          Quarantine offending message and stop engine.
RollbackAndStop
          Stop the engine.
 
Method Summary
static AepEngine.AppExceptionHandlingPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AepEngine.AppExceptionHandlingPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LogExceptionAndContinue

public static final AepEngine.AppExceptionHandlingPolicy LogExceptionAndContinue
Log an exception and continue operating.

With this policy, upon receipt of an unchecked exception from an application's event/message handler, the engine:

  1. logs the exception received from the application
  2. stops processing the message
  3. acknowledges it
  4. and continues to process new events queued for execution.
So essentially message processing stops where it is and from an HA standpoint the message is removed from the processing stream.

When applied to an exception thrown from a message filter the message will not be dispatched to application event handlers.

In all cases the message will not be considered to be part of the transaction and is acknowledged upstream.


RollbackAndStop

public static final AepEngine.AppExceptionHandlingPolicy RollbackAndStop
Stop the engine.

With this policy, upon receipt of an unchecked exception from an application handler, the engine:

  1. Rolls back the transaction in which the exception was thrown (leaving any previous messages in the transaction if adapatively batched unacknowledged and uncommitted).
  2. Schedules an engine stop to be triggered after in-flight transactions have completed (excluding those in the current adaptive batch). Completion of prior transactions:
    • allows messages in prior transactions to be acknowledged upstream.
    • because the engine is stopped with an exception, channel joins are preserved
    • and a backup, if running, will take over.
    • the backup will reprocess any of the unacknowledged messages.
If the engine cannot complete prior transactions due to a subsequent error the engine is still stopped with an exception and a backup will reprocess messages from incomplete transactions as well.

Note that even if all prior transactions complete successfully is currently possible that that not all stabilized transactions will be reported to a backup or the transaction log ... in such cases it is possible that outbound message redelivery can occur on failover or recovery, though those messages will be filtered by duplicate checking at the downstream receiver if enabled. In this regard a RollbackAndStop failure in which an application isn't using duplicate checking has the same redelivery guarantees for outbound messaging as a process failure except that inbound messages are acknowledged upstream on a best effort basis. This doesn't impose any additional coding requirements on application not using duplicate checking as they must tolerate duplicates to protect against process failure anyway.

This is the default policy.


QuarantineAndStop

public static final AepEngine.AppExceptionHandlingPolicy QuarantineAndStop
Quarantine offending message and stop engine.

With this policy, upon receipt of an unchecked exception from an application's event/message handler, the engine:

  1. Rolls back the transaction in which the exception was thrown (leaving any previous messages in the transaction (if adapatively batched) unacknowledged) and
  2. Starts a new transaction that solely consists of the sending of the offending message through the configured quanrantine channel and
  3. shuts down after the completion of the transaction. Shutting down after the completion of the quarantine transaction implies that:
    • the engine ensures successful delivery of the quarantine message (i.e. it waits for the send acknowledgement to be received) and
    • it acknowledges the offeniding message up stream before shutting down.
    • Note that the shutdown will shutdown with the exception thrown by the application - in other words the shutdown is not a graceful shutdown meaning that subscriptions are left in tact and a backup if running will take over.

Method Detail

values

public static AepEngine.AppExceptionHandlingPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AepEngine.AppExceptionHandlingPolicy c : AepEngine.AppExceptionHandlingPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AepEngine.AppExceptionHandlingPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.