Yes you should use the service pub.flow:throwExceptionForRetry instead of Exit flow and signal failure and the Exit with failure should be in the catch sequence block as always and any child service error with throwException message will get trapped inside the parent/main flow for the error handling framework.
I’ve been trying as your suggestion. My service invoked three times, and then popped message increase.
But all that I want is while my JMS trigger consume message from JMS server and then error occurred in message routing, then message suspended for awhile so my JMS trigger can consume message again.
message popped only when my JMS trigger already processed message successfully.
Sorry for my unclear explanation.
Is there another way to meet this requirement ?
Maybe there is another best practice for this.
The way you have your trigger configured, the message should not have been “popped” or dequeued. Once your trigger becomes suspended, the message will sit there until the trigger gets resumed. Did you try resuming the trigger to make sure the same message came through again?
my bad, I did various test before and forget to chance Exit flow on failure instead of throwExceptionForRetry and set suspend on error = true.
now suspend on error = false and using throwExceptionForRetry in my message routing service.
Now it’s running well.