Class EsbTriggerHandler
java.lang.Object
com.kingsrook.qqq.esb.runtime.EsbTriggerHandler
Runs a trigger's process for ESB events (spec section 6), plus the per-message
helpers that EsbTriggerRunner uses around a run: the attempt number, backoff,
error text, and dead-letter messages.
runProcess is one triggered run. It is also what a dead-letter replay calls,
so it can be called from any thread, including one that has a QContext of its
own (which it puts back when done). A run:
- uses a QContext with the handler's instance and the trigger's run-as
session (runAsSessionSupplier, or a QSystemUserSession by default);
- checks the session's permission to the process (QPermissionDeniedException
if denied);
- runs the process with FrontendStepBehavior.SKIP, and the events as the
esbMessages value (an ArrayList of EsbEvent; size 1 in SINGLE mode);
- when the process has a table, and some events are from that table (their
source is qqq://instance/table/thatTable), sets a QProcessCallback whose
filter is primaryKey IN (those events' subjects) - so a table-bound process
runs on the changed records, as it would when run on selected records;
- in SINGLE mode, sets EsbCausation to the event's id for the run, so events
published during the run point back at it. BATCH runs (one run, many
causes) leave causation as it was.
A failed run throws: the process's exception, as RunProcessAction throws it.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEsbTriggerHandler(QInstance qInstance) Constructor - for runs against this instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidrunProcess(EsbTrigger trigger, String processName, List<EsbEvent> events) Run the trigger's process (processName - the process the trigger is on) for some events: see the class comment.
-
Field Details
-
VALUE_ESB_MESSAGES
- See Also:
-
PROPERTY_ERROR
//////////////////////////////////////////////////////////////- See Also:
-
PROPERTY_FAILED_TRIGGER
- See Also:
-
PROPERTY_ATTEMPTS
- See Also:
-
PROPERTY_FAILED_AT
- See Also:
-
PROPERTY_BODY_DROPPED
- See Also:
-
ERROR_UNPARSEABLE
- See Also:
-
MAX_ERROR_LENGTH
-
-
Constructor Details
-
EsbTriggerHandler
Constructor - for runs against this instance.
-
-
Method Details
-
runProcess
-