serviceTask ,http-connector retry number of times

Hi ,
I am new new camunda , through serviceTask invoking http calls , if http call response fails
i want retry 5 times , here attaching sample serviceTask

 <bpmn:serviceTask id="one" name="Connect">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">http://logic.com/connect</camunda:inputParameter>
            <camunda:inputParameter name="method">POST</camunda:inputParameter>
            <camunda:inputParameter name="headers">
              <camunda:map>
                <camunda:entry key="accept">application/json</camunda:entry>
                <camunda:entry key="content-type">application/json</camunda:entry>
              </camunda:map>
            </camunda:inputParameter>
            <camunda:inputParameter name="payload">
              <camunda:script scriptFormat="JavaScript"><![CDATA[var req = {"name": execution.getVariable("Name")};
print(JSON.stringify(req));
JSON.stringify(req);]]></camunda:script>
            </camunda:inputParameter>
            <camunda:outputParameter name="Name">
              <camunda:script scriptFormat="Javascript"><![CDATA[   print ('RESPONSE :e ');   
               var jsonResp = S(response); 
               print ('jsonResp ' +jsonResp);
               //any error happen ,retry 15 times  
              ]]></camunda:script>
            </camunda:outputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      </bpmn:serviceTask>

If you make the task asynchronous as in:

<serviceTask id="failingServiceTask" camunda:asyncBefore="true">

the task will be handled by the job executor which is, by default, retrying 3 times, but can be configured to 5 times [1]:

<serviceTask id="failingServiceTask" camunda:asyncBefore="true">
    <extensionElements>
      <camunda:failedJobRetryTimeCycle>R5/PT5M</camunda:failedJobRetryTimeCycle>
    </extensionElements>
</serviceTask>

[1] https://docs.camunda.org/manual/7.8/user-guide/process-engine/the-job-executor/#failed-jobs

2 Likes