EN - Apache Kafka 2022
EN - Apache Kafka 2022
Apache Kafka
camunda.de
2 Contents
Contents
Microservice orchestration 3
What’s next? 7
camunda.de
3 Microservice orchestration
Apache Kafka can help users implement a Let’s look at an example based on an actual
variety of use cases. Business processes customer project: You place an order in an
are often automated as a result of online store. The order is accepted via a
these implementations – consciously or checkout service. The system can now write an
unconsciously – and Apache Kafka is frequently event to Kafka stating that an order has been
combined with workflow engines. To explore placed (“order placed”). An order fulfillment
the automation of business processes in the service can respond to this event. This service
context of Apache Kafka further, this article will is then responsible for processing the order,
touch on the following topics: which requires it to communicate with other
services, such as a payment service that is used
1. Microservice orchestration to process the payment. This can also take
2. Event-driven architecture with “emergent place via Kafka, whereby a command is written
behavior” to Kafka and is then processed by the payment
3. Combining event streaming with workflow service. This sequence is shown in Figure One.
engines
The order fulfilment service now orchestrates
other services. The term “orchestrate” can be
Microservice orchestration understood in the same way as “coordinate”,
which you are perhaps more familiar with.
Many modern architectures rely on
microservices to split functionality into smaller, Of course, the necessary orchestration logic
manageable pieces. These microservices could be implemented in a programming
need to communicate with each other in order language of your choice. But orchestration in
to implement business functionality. This distributed systems has special requirements,
communication can take place via Kafka, where mostly because it is long-running. After all,
Kafka is used here in place of a message bus, you never know how long you’ll have to wait,
often in order to be able to scale accordingly. either for a payment to be received, or for
camunda.de
4 Microservice orchestration
a package labelling service to be available. This is why a workflow engine is used within the
This is why a workflow engine is an obvious order fulfillment microservice. Modern products
solution for implementing orchestration logic, allow a great deal of flexibility to be hooked
since it provides its own persistence and is in various architectures. Figure Two shows
therefore very good at waiting even long times. an example where Camunda SaaS is being
In addition, those tools allow the graphical used, while microservices are written in Java
representation of orchestration logic – not with Spring Boot. The microservices contain
just during development, but also during source code for combining the workflow engine
runtime. Diagnosing problems is one example with Apache Kafka as sketched in [1]. Different
of graphical representation during runtime. architectures are, of course, possible. If you
This is very helpful as such logic often needs want to dive deeper into process automation
to be discussed and understood by various architectures you might want to look into [2].
stakeholders such as business or domain
specialists, infrastructure people, and, of course, 1 https://github.com/berndruecker/kafka-camunda-spring-simple
developers. 2 https://processautomationbook.com/
camunda.de
5 Event-driven architecture and emergent behavior
camunda.de
6 What’s next?
for example, to arrange for vehicle maintenance This model works very well and connects the
or even to stop the vehicle immediately in an world of event streaming, often in the context of
emergency. The workflow engine is relevant in IoT and mass data, with processes to organize
those processes whenever they become long responses that are then often long-running.
running, for example if humans are involved. We will be seeing this model a lot more in the
Figure Three shows a simplified version of a future.
process model that can be executed directly in
the workflow engine.
camunda.de
7 What’s next?
Figure Four: Schematic interaction between the event stream and workflow engine
What’s next?
This article explored two typical models for
linking Apache Kafka with a workflow engine:
microservice orchestration and responding
to insights in event streams via long-running
processes. This was a high-level overview, your
next step could be to look at the technical
details. These can depend on a number of
parameters, including the architecture and
stack, the specific tools or the program
language. Unfortunately, there isn’t enough
time to explore that in this blog post, but I
hope this has piqued your interest, and if so,
I recommend reading the book “Practical
Process Automation” or taking a look at the
book’s website. These resources explore the
topic further and also provide links to specific
code examples to get you started.
4 https://forum.confluent.io/
5 https://forum.camunda.io/
camunda.de
Bernd Rücker
Chief Technologist and Co-Founder of
Camunda
About Camunda
Camunda is the leader in process orchestration software. Our software helps orchestrate
complex business processes that span people, systems, and devices. With Camunda,
business users collaborate with developers to model and automate end-to-end processes
using BPMN-powered flowcharts that run with the speed, scale, and resiliency required to
compete in today’s digital-first world. Hundreds of enterprises such as Allianz, ING, and
Vodafone design, automate, and improve mission-critical business processes with Camunda
to drive digital transformation. To learn more visit camunda.com.