Interface EventQueueItem

All Known Implementing Classes:
ReplicatedEventQueueItem

public interface EventQueueItem
Represents an item that can be enqueued/dequeued in an EventQueue.

This abstraction allows the queue to track whether events originated locally or were received from replication, enabling proper handling of the replication loop prevention mechanism.

  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the event contained in this queue item.
    boolean
    Checks if this item represents a replicated event.
  • Method Details

    • getEvent

      Event getEvent()
      Gets the event contained in this queue item.
      Returns:
      the event
    • isReplicated

      boolean isReplicated()
      Checks if this item represents a replicated event.

      Replicated events are those received from other nodes in the cluster via the replication mechanism (e.g., Kafka). Local events are those enqueued directly by the local agent execution.

      This distinction is important to prevent replication loops - replicated events should not be re-replicated to other nodes.

      Returns:
      true if this event was replicated from another node, false if it's a local event