Enum OutboxEventProcessingOrder

java.lang.Object
java.lang.Enum<OutboxEventProcessingOrder>
org.hibernate.search.mapper.orm.outboxpolling.cfg.OutboxEventProcessingOrder
All Implemented Interfaces:
Serializable, Comparable<OutboxEventProcessingOrder>

@Incubating public enum OutboxEventProcessingOrder extends Enum<OutboxEventProcessingOrder>
  • Enum Constant Details

    • AUTO

      public static final OutboxEventProcessingOrder AUTO
      Process outbox events in the safest, most appropriate order based on the dialect and other settings.
      • When using time-based UUIDs for outbox events (UuidGenerationStrategy.TIME), use ID order.
      • Otherwise, if using a Microsoft SQL Server dialect, don't use any particular order (NONE).
      • Otherwise, use TIME order.
    • NONE

      public static final OutboxEventProcessingOrder NONE
      Process outbox events in no particular order.

      This essentially means events will be consumed in a database-specific, undetermined order.

      In setups with multiple event processors, this reduces the rate of background failures caused by transaction deadlocks (in particular with Microsoft SQL Server), which does not technically "fix" event processing (those failures are handled automatically by trying again anyway), but may improve performance and reduce unnecessary noise in logs.

      However, this may lead to situations where the processing of one particular event is continuously postponed due to newer events being processed before that particular event, which can be a problem in write-intensive scenarios where the event queue is never empty.

    • TIME

      public static final OutboxEventProcessingOrder TIME
      Process outbox events in "time" order, i.e. in the order events are created.

      This ensures events are processed more or less in the order they were created and avoids situations where the processing of one particular event is continuously postponed due to newer events being processed before that particular event.

      However, in setups with multiple event processors, this may increase the rate of background failures caused by transaction deadlocks (in particular with Microsoft SQL Server), which does not technically break event processing (those failures are handled automatically by trying again anyway), but may reduce performance and lead to unnecessary noise in logs.

    • ID

      public static final OutboxEventProcessingOrder ID
      Process outbox events in identifier order.

      If outbox event identifiers are time-based UUIDs, this behaves similarly to TIME, but without the risk of deadlocks.

      If outbox event identifiers are random UUIDs, this behaves similarly to NONE.

  • Method Details

    • values

      public static OutboxEventProcessingOrder[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static OutboxEventProcessingOrder 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
    • externalRepresentation

      public String externalRepresentation()
    • of

      public static OutboxEventProcessingOrder of(String value)