Hi - Just wanted to ask about the correct way to build an IS trigger service that must retry until it succeeds.
The requirements are:
- the trigger gets a document from the broker and executes the IS trigger service.
- if the trigger service fails, the document stays on the broker queue
- the trigger keeps retrying the same document - if it succeeds, the document is removed from the broker queue
To meet these requirements, here’s what I do:
• Set trigger ‘Retry failure behavior’ property to ‘Suspend and retry later’
• Set a suitable trigger resource monitoring service
Trigger Service Structure
• The following Flow service structure is used:
[b]Try/Catch - Outer Sequence[/b] [b]Try Sequence[/b] (service steps) [b]Catch Sequence[/b] Set error flag to ‘true’ [b]BRANCH on error flag[/b] If 'true', throw pub.flow:throwExceptionForRetry
The trigger service structure is pretty strict. For instance, if I move the ‘BRANCH on error /throwExceptionForRetry’ code block to be under the ‘Catch’ sequence, it does not work – the service just fails, no retry occurs and the document does not stay enqueued on the broker.
Is this the right way to setup a retry-capable IS trigger? Is the structure of the IS Trigger Service correct? Specifically, I was wondering why the ‘BRANCH’ does not work under the ‘Catch’ sequence.