Class DirectTriggerService
java.lang.Object
org.chenile.trigger.DirectTriggerService
- All Implemented Interfaces:
TriggerService
Raises the event at once, in the caller's thread, and returns when every subscriber has
finished. A failure is rethrown to the caller and the idempotency key is released so that the
caller can retry.
Deduplication and status are kept in memory, per node, for a limited time: this is the default for applications without process management. Process management replaces it with a durable, outbox-backed implementation that deduplicates across nodes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classA thread-safe map that forgets entries after a time to live and keeps at most a fixed number of them, dropping the oldest first.private static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DirectTriggerService.RecentEntries<List<String>, String> private final Clockstatic final Stringprivate final EventProcessorstatic final Stringprivate final TriggerRequestsstatic final Stringprivate final DirectTriggerService.RecentEntries<String, DirectTriggerService.Tracked> static final String -
Constructor Summary
ConstructorsConstructorDescriptionDirectTriggerService(EventProcessor events, Duration retention, int maxEntries) DirectTriggerService(EventProcessor events, Duration retention, int maxEntries, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringThe subscriber's own message: Chenile wraps it in a ServerException, which we wrap again.private voidRaises the event; nobody listening or a failed subscriber is an error.private voidrecord(String tenant, String id, TriggerInput input, Instant triggerTime, Instant startedAt, String status, Instant finishedAt, String error) trigger(TriggerInput input)
-
Field Details
-
RUNNING
- See Also:
-
DONE
- See Also:
-
FAILED
- See Also:
-
TRIGGER_NOT_FOUND
- See Also:
-
events
-
requests
-
clock
-
acceptedKeys
-
statuses
-
-
Constructor Details
-
DirectTriggerService
-
DirectTriggerService
-
-
Method Details
-
trigger
- Specified by:
triggerin interfaceTriggerService
-
status
- Specified by:
statusin interfaceTriggerService
-
raise
-
record
-
message
-
CHENILE