How does a job worker know the result of an interface call

How does a job worker know the result of an interface call?

There is a common service choreography platform, it will handle different restful api of many customer, it has Different API Specifications, So I don’t know what response code represents success, what represents failure.

How should I handle this situation?

Thank you very mush!

@ekoATgithub You should model one service task per API. So that you can independently handle the response codes at service task based on the api contracts.

Hi aravindhrs:

Thank you for your solution.

1)That means it need to customize the development of job worker in different user case?
2)Is it possible to implement a generic HTTP job worker to handle different specification apis? Or other best practices?

To keep it generic validation for 2xx responses, instead of checking status codes for 200, 201, 202, 204, etc. you can check like below:

httpStatus.is2xxSuccessful()

It covers all successful cases.

Hi~ aravindhrs

There are 4 service node, how to control the business transaction in engine?

4 nodes? What type of cluster setup?

Homogeneous or Heterogeneous cluster?

All services uses same db schema?

Sorry, my expression is wrong, not 4 nodes, but 4 service tasks, as shown in the figure.

it’s Homogeneous cluster.

All service uses same db sachema.

Refer these pages on transactions-in-processes and additional-save-points.

You can control the transactions in engine via configurable save points, so that you can decide on when to rollback or save the current state of the activity or a transaction.

It can be achieved by configuring on above service tasks like:

camunda:asyncBefore="true"

or

camunda:asyncAfter="true"