hsingh
hsingh

Reputation: 681

Can Activiti be used for Microservice Orchestration?

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

Answers (2)

rob2universe
rob2universe

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:

  • state management and long running processes / persistence for data
  • versioning (!)
  • retries and error handling
  • tooling to modify state and date in case something went wrong
  • timeouts, parallel execution (if necessary)
  • scalability of the orchestration
  • graphical process model
  • audit trail
  • and end to end visibility in monitoring tools based on BPMN 2 model
  • ability to include business rules tasks (DMN) for more complex rules
  • combination of push and pull communication pattern and a/sync communication
  • business-IT alignment via BPMN 2
  • support for the various BPMN 2 events
  • standardization (skills, security, software quality, features) ...

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

Greg Harley
Greg Harley

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

Related Questions