Your company might want to move to a microservices architecture and automate workflows (I'm not going into motivation in this blog post, but you might want to read about 5 Workflow Automation Use Cases You Might Not Have Considered or BizDevOps - the true value proposition of workflow engines ). This puts you in line with many of our clients . As a rule, you will have questions:
- Scope and Boundaries - What kind of workflow you want to automate and how it fits into multiple microservices, or a limited context in your landscape. I'm limited to the length of this post, so I won't cover this topic today, but you might want to read Avoiding the “BPM monolith” when using bounded contexts or Real-Life BPMN .
- Stack and tools - which process engine can I use?
- Architecture - am I running the process engine centrally or decentralized?
- Management - who owns the workflow model and how do I deploy it?
- Operations - How Do I Maintain Control?
, . , .
, -, . :
- — ?
- 3 : , RPC- «-»,
, , , flowing-retail GitHub. flowing-retail , . , Camunda BPM Zeebe. — , , .
, - (, Amazon) .
? ?
, , , ( «Microservices» Martin Fowler). Event-driven .
, . . , , , . , , . , , . , . , « - ?» « - , ?» . Complex event flows in distributed systems (, , QCon - DevConf ).
: https://github.com/berndruecker/flowing-retail/tree/master/kafka/java/choreography-alternative
, , . (. ), , , , , . Monitoring and Orchestration of Your Microservices Landscape with Kafka and Zeebe ( Kafka Summit -).
, . - , :
:
. , , . , , . , , :
flowing-retail , -: !
—
? , , ( ).
- ( )
- «-» / ( REST)
, , , .
. . . (« , , ») , (« , O42»).
- : Kafka, RabbitMQ (AMQP), JMS.
- : -, / , , , , Saga pattern, «Lost in transaction» (, , JavaZone Oslo).
- : https://github.com/berndruecker/flowing-retail/tree/master/kafka/java
- : ; - ; (, ) , .
- : , . , « ». .
- /
, , . — REST. . REST, — , ( , , , QCon London).
- : REST, SOAP, gRPC; : https://www.rabbitmq.com/tutorials/tutorial-six-java.html
- : (, ), -, / , , Saga pattern, «Lost in transaction» (, , JavaZone Oslo).
- : https://github.com/berndruecker/flowing-retail/tree/master/rest
- : ; .
- : , ; (, Circuit Breaker).
, , . .
- : External Tasks (Camunda BPM) Workers (Zeebe).
- : , -, / , , Saga pattern, «Lost in transaction» (, , JavaZone Oslo).
- : https://github.com/berndruecker/flowing-retail/tree/master/zeebe
- : ; .
- : ; — (, REST Messaging).
. , , , .
, Kafka Messaging, . , , REST, , , Spring Boot, . , , , , . Domain-driven design (DDD) , , Akka Axon, , , .
, , , . , , . , - , . , , , .
, . :
- , .
- , .
- , .
Architecture options to run a workflow engine.
. , , , . , () .
- : https://github.com/berndruecker/flowing-retail/tree/master/kafka/java/order-camunda
- : ; .
- : ( ); « » ().
: « , »?
. DevOps , . , , , .
, , , . , , , Elastic. (, , , ). . , , .
, , Camunda Optimize Zeebe Operate.
. , . REST (Camunda BPM) gRPC (Zeebe).
, , , .
,
. Camunda, (, Spring Boot Starter) . , . .
- : « ».
- : , , , Rolling Upgrade Deployment Aware Process Engine.
. .
. , , . . , : , . , — .
— , Camunda, , , . , , , .
, . , , - , .
, , , , .
(: ) , , .
, .
flowing-retail :
- : - .
- : .
, - . BPM — , - , — , .
« »?
: « »? : , , « ».
-, , , . , , , , , — . , , — , , , .
« », , , ( , ,…). , , . .
, . , . :
: , RPC- . :
Ownership of workflow models should be within the purview of the respective microservice. The workflow should be clearly focused on this area.
You can run the workflow engine centrally or decentralized .
Track or Control - You should strive for a balanced mix of choreography and orchestration .