Package outbox.poller
Class OutboxPoller
java.lang.Object
outbox.poller.OutboxPoller
- All Implemented Interfaces:
AutoCloseable
Scheduled database scanner that polls for pending outbox events as a fallback
when the hot path is unavailable or events are dropped.
Supports claim-based locking via ownerId/lockTimeout for safe
multi-instance deployments. Create instances via builder().
This class is thread-safe. The start() and close() methods are
synchronized to prevent concurrent lifecycle transitions.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic OutboxPoller.Builderbuilder()voidclose()Cancels the polling schedule and shuts down the scheduler thread.voidpoll()Executes a single poll cycle.voidstart()Starts the scheduled polling loop.
-
Method Details
-
builder
-
start
public void start()Starts the scheduled polling loop. Subsequent calls are no-ops if already started. -
poll
public void poll()Executes a single poll cycle. Called automatically by the scheduler, but may also be invoked directly for testing. -
close
public void close()Cancels the polling schedule and shuts down the scheduler thread.- Specified by:
closein interfaceAutoCloseable
-