Reputation: 681
I have multiple microservices. Each microservice has REST endpoints. I want to orchestrate microservices for creating a workflow. Is it possible with Activiti? Will it be possible without writing any code?
Assume each microservice gets some input and returns some output (which can be used as input for the next microservice), can Activiti provide a way to pass output from one microservice to another microservice directly?
Upvotes: 0
Views: 973
Reputation: 7583
Yes, any process engine can be used in this way. You most likely write a little glue code for data mapping / connectors.
Benefits of covering the orchestration part with a BPMN2 process engine include for instance ootb support for:
This is a great related article about the WHY: https://blog.bernd-ruecker.com/3-common-pitfalls-in-microservice-integration-and-how-to-avoid-them-3f27a442cd07
This is about the important design consideration in case you go with a process engine: https://blog.bernd-ruecker.com/the-microservice-workflow-automation-cheat-sheet-fc0a80dc25aa
Upvotes: 0
Reputation: 3240
Activiti, like most other BPM platforms can certainly be used for microservice orchestration. But there are many caveats. Long running microservices (i.e. that don't immediately return results) can potentially block the BPM process which may not be ideal, services may require authentication and other times a microservice will place results in a repository or queue which will need to be picked up by the BPM process using a service task. There is a good article that discusses the synchronous vs asynchronous invocation at the following Camunda blog post : https://camunda.com/blog/2013/11/bpmn-service-synchronous-asynchronous/
While this is a Camunda post, the same pattern can be easily handled by Activiti.
You other question was about whether you could do this without writing code. The answer is it depends. The most trivial orchestration of synchronous ReST calls can likely be handled without writing code, but once you start using asynchronous services where results may not be placed into the ReST response, or long running service calls, or even if the service calls have something other than basic authentication then it is possible you will need to write some Java Delegate service tasks.
Upvotes: 2