Class InMemoryStore

java.lang.Object
com.babelqueue.idempotency.InMemoryStore
All Implemented Interfaces:
Store

public final class InMemoryStore extends Object implements Store
Process-local, thread-safe Store backed by a concurrent set. For tests and single-process consumers; it is not shared across workers and not persistent — use a Redis- or database-backed store for production fleets.
  • Constructor Details

    • InMemoryStore

      public InMemoryStore()
  • Method Details

    • seen

      public boolean seen(String messageId)
      Description copied from interface: Store
      Whether this message id has already been processed (remembered).
      Specified by:
      seen in interface Store
    • remember

      public void remember(String messageId)
      Description copied from interface: Store
      Records this message id as processed.
      Specified by:
      remember in interface Store
    • forget

      public void forget(String messageId)
      Description copied from interface: Store
      Drops an id from the store (manual eviction; a backend may also expire ids).
      Specified by:
      forget in interface Store