Retrieve Max attempt from a trigger

Hi Experts,

I’m new to WM. The info. on throwExceptionForRetry here is really helpful. I have a related question: how do I retrieve the Max. attempts property programmatically?

Thanks in advance.

Please check this old thread link,it is helpful
http://www.wmusers.com/wmusers/messages/100/49624.shtml

Also use the keyword search in this site on “throwExceptionForRetry” you will hit with many results.

Goodluck,

Thanks RMG.

I’ve done both and read all forums related to this but haven’t found the specifics.

Any help is appreciated.

Thanks again.

Hi Quoc Nquyen,
Here is one approach for “throwExceptionForRetry” service.

Sequence(exit on success)
|------Sequence(exit on failure, try block)
|------Sequence(exit on done, catch block)
Sequence(exit on failure, throw exception block)
|----pub.flow:getRetryCount
|----Branch(on retryCount)
|-------retryCount=0(do some thing…)
|-------retryCount=max(do some thing…)
|----pub.flow:throwExceptionForRetry

retryCount=max means the maximum number of times the Integration Server retries a trigger service depends on the value of
the Max attempts property for the trigger.

pub.flow:throwExceptionForRetry service is used to handle transient errors that might occur during execution of a trigger service. A transient error is an error that arises from a condition that might be
resolved quickly, such as the unavailability of a resource due to network issues or failure to connect to a database. The trigger service might execute successfully if the Integration Server waits and then retries the service. If a transient error occurs, the trigger service can catch this error and instruct the server to retry the trigger service by invoking pub.flow:throwExceptionForRetry.(reference IntegrationServerBISReference.pdf)

Hi Quoc Nquyen,
Sorry forgot to reply your main query!

one way you can do it is ,make a config file where you can put published doc name and maximum retries, as name=value pair and read the config file using java service giving input as (string)document name and output as maximum retries(string).This way you can get max. attempts programmatically

Regards,
Puneet Saxena

Thanks Puneet.

I’ve considered that approach already. What I’m trying to find out is that if there is something like pub.flow:getRetryCount for the max attempts property or how to write a Java service to get the max attempts that was set. I’m trying to avoid updating the max attempts in two places (the property itself and the config. file) when it changes.

Thanks again.