SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
Using Zeebe with Spring Boot
and Apache Camel
CamundaCon 2018 - Jan Galinski
@holisticon @jangalinski
About me
■ Jan Galinski (Holisticon AG)
■ github.com/jangalinski
Agenda
■ What is ...
□ ... Zeebe?
□ ... spring-zeebe?
□ ... Apache Camel?
□ ... camel-zeebe?
■ Live Demo: facebam
■ Conclusion
what you won't see
■ Docker
■ kafka/rabbitMQ
■ serverless
I am sorry!
Workflow Engine for Microservices Orchestration
http://zeebe.io
zeebe
■ developed by camunda
■ decentralized process engine
■ orchestration of microservices
■ current version 0.11.0 (release planned
2019/Q1)
■ Broker and Client API
"Spring on steroids"
http://start.spring.io
spring boot
■ developed by pivotal
■ current version 2.0.5 (2018/09)
■ annotation based
■ opinionated - convention over configuration
■ "starter" concept
■ executable jars
Hello World!
mvn spring-boot:run
@SpringBootApplication
@RestController
public class MyApplication {
public static void main(String... args) {
SpringApplication.run(MyApplication.class, args);
}
@GetMapping("/")
public String hello() {
return "hello World";
}
}
spring-zeebe
■ "Requested" by Bernd
■ First Release End 2017
■ can run broker and clients
■ yaml based configuration
■ allows annotation based subscriptions
■ current version: 0.3.0-SNAPSHOT
https://github.com/zeebe-io/spring-zeebe
Example: spring-zeebe-
starter
@SpringBootApplication
@EnableZeebeClient
public class WorkerApplication {
public static void main(final String... args) {
SpringApplication.run(WorkerApplication.class, args);
}
@ZeebeWorker(taskType = "sayHello")
public void sayHello(final JobClient client, final JobEvent job) {
client.newCompleteCommand(job)
.payload("{"hello": "world"}")
.send().join();
}
}
Route based enterprise integration framework
http://camel.apache.org/
Apache Camel
■ Apache Foundation Open Source
■ First commit 2007 (!)
■ Implements Enterprise Integration Patterns
■ 200+ production ready components
■ (almost) any transport protocol
Camel building blocks
A Route
■ defines a data flow
■ starts with an Endpoint
■ can have (multiple) Processors modifying
data
■ ends with an Endpoint
Camel building blocks
An Endpoint
Is either a ...
■ Consumer - starts a route, creates an
Exchange
or a
■ Producer - ends a route, exposes Exchange
Camel building blocks
A Component
■ provides a name-space (file://folder)
■ is a factory for Endpoints
Camel building blocks
An Exchange
■ represents data in a Route
■ encloses Messages (In and Out)
■ Messages have a Header (Map) and a Body
Route Example
// subscribe to topic
from("activemq:topic?[options]")
.filter(doSomeFiltering())
// call a processor-method
.process(convertToPojo())
// process input using spring service
.bean(TheBusinessService.class)
// write csv
.marshal().csv()
// store result on server
.to("ftp:host?[options]")
Camel Zeebe
work in progress
https://github.com/holunda-io/camel-zeebe
Motivation
■ Do not assume that worker can connect to
broker via tcp
■ do not require worker to speak "zeebe"
■ support any worker language
■ support any messaging protocol
Camel Zeebe API
■ immutable Commands and Events
■ no dependency on zeebe-lib
■ Supports
□ Register Self
□ Start Process
□ Complete Job
□ ...
Camel Zeebe API
data class StartProcessCommand(
val bpmnProcessId: String,
val payload: Json? = null
)
interface StartProcessGateway {
companion object { const val ENDPOINT = "direct:startProcess" }
fun send(command: StartProcessCommand)
}
startProcessGateway.send(StartProcessCommand("process_dummy", <payloadJson>))
Camel Zeebe Core
■ Zeebe Client connected to Broker
■ Camel Component defining zeebe://...
■ Provides Endpoints to
□ Register Worker
□ Start Process
□ Complete Job
□ ...
Camel Zeebe Core
class ProcessStartEndpoint(context: ZeebeComponentContext) : ZeebeProducerOnlyEndpoint(...) {
override fun createProducer(): Producer = object : DefaultProducer(this) {
override fun process(exchange: Exchange) {
val cmd = exchange.getIn().getMandatoryBody(StartProcessCommand::class.java)
context.workflowClient
.newCreateInstanceCommand()
.bpmnProcessId(cmd.bpmnProcessId)
.latestVersion()
.payload(cmd.payload)
.send()
.join()
}
}
}
Demo
Zeebe Camel Facebam
https://github.com/holunda-io/zeebe-camel-
facebam
Architecture
Dynamic
>
  Let there be code  
   
Now you tell me:
Was that cool or what?
But wait ...
... there is more
Everyone!
Take a picture
and mail it to:
holunda.io@gmail.com
Conclusion
What just happened
■ Zeebe Broker does not know workers
■ Workers do not use Zeebe-API
■ Only Orchestrator is connected to Broker
■ Camel routes connect everything
What we could do
■ replace file system with messaging
infrastructure
■ any camel supported route will work out of the
box
■ any program that can write/read the JSON-API
can be a worker
■ Test routes by mocking components
But wait ...
... ah, no - that was it!
Thank you
Simon Zambrovski
Simon Sprünker

Mais conteúdo relacionado

Mais procurados

Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
SVDevOps
 

Mais procurados (20)

Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
APIConnect Security Best Practice
APIConnect Security Best PracticeAPIConnect Security Best Practice
APIConnect Security Best Practice
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 
Micro Frontends Architecture
Micro Frontends ArchitectureMicro Frontends Architecture
Micro Frontends Architecture
 
Introduction to Spring Cloud
Introduction to Spring Cloud           Introduction to Spring Cloud
Introduction to Spring Cloud
 
Camunda Docker
Camunda DockerCamunda Docker
Camunda Docker
 
Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!
 
Let's build a simple app with .net 6 asp.net core web api, react, and elasti...
Let's build a simple app with  .net 6 asp.net core web api, react, and elasti...Let's build a simple app with  .net 6 asp.net core web api, react, and elasti...
Let's build a simple app with .net 6 asp.net core web api, react, and elasti...
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data Access
 
Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
 Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
 
Multi cluster management with rancher
Multi cluster management with rancherMulti cluster management with rancher
Multi cluster management with rancher
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Building a Web Application with Kafka as your Database
Building a Web Application with Kafka as your DatabaseBuilding a Web Application with Kafka as your Database
Building a Web Application with Kafka as your Database
 
DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub Actions
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 

Semelhante a CamundaCon 2018: Using Zeebe with Spring Boot and Apache Camel (Holisticon)

Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
som_nangia
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
wilburlo
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Kyle Drake
 
Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008
Jeffrey Clark
 

Semelhante a CamundaCon 2018: Using Zeebe with Spring Boot and Apache Camel (Holisticon) (20)

Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
 
server side Swift
server side Swift server side Swift
server side Swift
 
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache Camel
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
 
Pump up the JAM with Gatsby
Pump up the JAM with GatsbyPump up the JAM with Gatsby
Pump up the JAM with Gatsby
 
Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008
 
Introduction to Xamarin.Forms
Introduction to Xamarin.FormsIntroduction to Xamarin.Forms
Introduction to Xamarin.Forms
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
 
Intro to go web assembly
Intro to go web assemblyIntro to go web assembly
Intro to go web assembly
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with Ruby
 
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
 
Run C++ as serverless with GCP Cloud Functions
Run C++ as serverless with GCP Cloud FunctionsRun C++ as serverless with GCP Cloud Functions
Run C++ as serverless with GCP Cloud Functions
 

Mais de camunda services GmbH

Camunda BPM 7.13 Webinar
Camunda BPM 7.13 WebinarCamunda BPM 7.13 Webinar
Camunda BPM 7.13 Webinar
camunda services GmbH
 

Mais de camunda services GmbH (20)

Using Camunda on Kubernetes through Operators
Using Camunda on Kubernetes through OperatorsUsing Camunda on Kubernetes through Operators
Using Camunda on Kubernetes through Operators
 
Predictive Process Monitoring in Camunda
Predictive Process Monitoring in CamundaPredictive Process Monitoring in Camunda
Predictive Process Monitoring in Camunda
 
Camunda Product Update – The present and the future of Process Automation
Camunda Product Update – The present and the future of Process AutomationCamunda Product Update – The present and the future of Process Automation
Camunda Product Update – The present and the future of Process Automation
 
Tips on how to build Camunda Run for production
Tips on how to build Camunda Run for productionTips on how to build Camunda Run for production
Tips on how to build Camunda Run for production
 
Process Driven Customer Interaction
Process Driven Customer InteractionProcess Driven Customer Interaction
Process Driven Customer Interaction
 
Exploring Automation in Government
Exploring Automation in GovernmentExploring Automation in Government
Exploring Automation in Government
 
The Pulse of Process Automation
The Pulse of Process AutomationThe Pulse of Process Automation
The Pulse of Process Automation
 
Blitzumfrage zur aktuellen Nutzung von Prozessautomatisierung in Unternehmen
Blitzumfrage zur aktuellen Nutzung von Prozessautomatisierung in UnternehmenBlitzumfrage zur aktuellen Nutzung von Prozessautomatisierung in Unternehmen
Blitzumfrage zur aktuellen Nutzung von Prozessautomatisierung in Unternehmen
 
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
Webinar - A Developer's Quick Start Guide to Open Source Process Automation U...
 
Extending human workflow preparing people and processes for the digital era w...
Extending human workflow preparing people and processes for the digital era w...Extending human workflow preparing people and processes for the digital era w...
Extending human workflow preparing people and processes for the digital era w...
 
Camunda BPM 7.13 Webinar
Camunda BPM 7.13 WebinarCamunda BPM 7.13 Webinar
Camunda BPM 7.13 Webinar
 
[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0
 
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
Webinar: Monitoring & Orchestrating Your Microservices Landscape using Workfl...
 
Process Automation Forum, Processautomatisierung neu gedacht für das digitale...
Process Automation Forum, Processautomatisierung neu gedacht für das digitale...Process Automation Forum, Processautomatisierung neu gedacht für das digitale...
Process Automation Forum, Processautomatisierung neu gedacht für das digitale...
 
Process Automation Forum Zurich, finnova AG Bankware
Process Automation Forum Zurich, finnova AG BankwareProcess Automation Forum Zurich, finnova AG Bankware
Process Automation Forum Zurich, finnova AG Bankware
 
Process Automation Forum Munich, Swiss Life
Process Automation Forum Munich, Swiss LifeProcess Automation Forum Munich, Swiss Life
Process Automation Forum Munich, Swiss Life
 
Process Automation Forum Vienna, A1 & J-IT
Process Automation Forum Vienna, A1 & J-ITProcess Automation Forum Vienna, A1 & J-IT
Process Automation Forum Vienna, A1 & J-IT
 
Process Automation Forum Vienna, Raiffeisen
Process Automation Forum Vienna, RaiffeisenProcess Automation Forum Vienna, Raiffeisen
Process Automation Forum Vienna, Raiffeisen
 
Process Automation Forum Düsseldorf, Provinzial Rheinland Versicherung AG
Process Automation Forum Düsseldorf, Provinzial Rheinland Versicherung AGProcess Automation Forum Düsseldorf, Provinzial Rheinland Versicherung AG
Process Automation Forum Düsseldorf, Provinzial Rheinland Versicherung AG
 
[Webinar] BPM Renaissance: 5 Tips to Thrive in a Cloud-Native World
[Webinar] BPM Renaissance: 5 Tips to Thrive in a Cloud-Native World[Webinar] BPM Renaissance: 5 Tips to Thrive in a Cloud-Native World
[Webinar] BPM Renaissance: 5 Tips to Thrive in a Cloud-Native World
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

CamundaCon 2018: Using Zeebe with Spring Boot and Apache Camel (Holisticon)

  • 1. Using Zeebe with Spring Boot and Apache Camel CamundaCon 2018 - Jan Galinski @holisticon @jangalinski
  • 2. About me ■ Jan Galinski (Holisticon AG) ■ github.com/jangalinski
  • 3. Agenda ■ What is ... □ ... Zeebe? □ ... spring-zeebe? □ ... Apache Camel? □ ... camel-zeebe? ■ Live Demo: facebam ■ Conclusion
  • 4. what you won't see ■ Docker ■ kafka/rabbitMQ ■ serverless I am sorry!
  • 5. Workflow Engine for Microservices Orchestration http://zeebe.io
  • 6. zeebe ■ developed by camunda ■ decentralized process engine ■ orchestration of microservices ■ current version 0.11.0 (release planned 2019/Q1) ■ Broker and Client API
  • 8. spring boot ■ developed by pivotal ■ current version 2.0.5 (2018/09) ■ annotation based ■ opinionated - convention over configuration ■ "starter" concept ■ executable jars
  • 9. Hello World! mvn spring-boot:run @SpringBootApplication @RestController public class MyApplication { public static void main(String... args) { SpringApplication.run(MyApplication.class, args); } @GetMapping("/") public String hello() { return "hello World"; } }
  • 10. spring-zeebe ■ "Requested" by Bernd ■ First Release End 2017 ■ can run broker and clients ■ yaml based configuration ■ allows annotation based subscriptions ■ current version: 0.3.0-SNAPSHOT https://github.com/zeebe-io/spring-zeebe
  • 11. Example: spring-zeebe- starter @SpringBootApplication @EnableZeebeClient public class WorkerApplication { public static void main(final String... args) { SpringApplication.run(WorkerApplication.class, args); } @ZeebeWorker(taskType = "sayHello") public void sayHello(final JobClient client, final JobEvent job) { client.newCompleteCommand(job) .payload("{"hello": "world"}") .send().join(); } }
  • 12. Route based enterprise integration framework http://camel.apache.org/
  • 13. Apache Camel ■ Apache Foundation Open Source ■ First commit 2007 (!) ■ Implements Enterprise Integration Patterns ■ 200+ production ready components ■ (almost) any transport protocol
  • 14.
  • 15. Camel building blocks A Route ■ defines a data flow ■ starts with an Endpoint ■ can have (multiple) Processors modifying data ■ ends with an Endpoint
  • 16. Camel building blocks An Endpoint Is either a ... ■ Consumer - starts a route, creates an Exchange or a ■ Producer - ends a route, exposes Exchange
  • 17. Camel building blocks A Component ■ provides a name-space (file://folder) ■ is a factory for Endpoints
  • 18. Camel building blocks An Exchange ■ represents data in a Route ■ encloses Messages (In and Out) ■ Messages have a Header (Map) and a Body
  • 19. Route Example // subscribe to topic from("activemq:topic?[options]") .filter(doSomeFiltering()) // call a processor-method .process(convertToPojo()) // process input using spring service .bean(TheBusinessService.class) // write csv .marshal().csv() // store result on server .to("ftp:host?[options]")
  • 20. Camel Zeebe work in progress https://github.com/holunda-io/camel-zeebe
  • 21. Motivation ■ Do not assume that worker can connect to broker via tcp ■ do not require worker to speak "zeebe" ■ support any worker language ■ support any messaging protocol
  • 22. Camel Zeebe API ■ immutable Commands and Events ■ no dependency on zeebe-lib ■ Supports □ Register Self □ Start Process □ Complete Job □ ...
  • 23. Camel Zeebe API data class StartProcessCommand( val bpmnProcessId: String, val payload: Json? = null ) interface StartProcessGateway { companion object { const val ENDPOINT = "direct:startProcess" } fun send(command: StartProcessCommand) } startProcessGateway.send(StartProcessCommand("process_dummy", <payloadJson>))
  • 24. Camel Zeebe Core ■ Zeebe Client connected to Broker ■ Camel Component defining zeebe://... ■ Provides Endpoints to □ Register Worker □ Start Process □ Complete Job □ ...
  • 25. Camel Zeebe Core class ProcessStartEndpoint(context: ZeebeComponentContext) : ZeebeProducerOnlyEndpoint(...) { override fun createProducer(): Producer = object : DefaultProducer(this) { override fun process(exchange: Exchange) { val cmd = exchange.getIn().getMandatoryBody(StartProcessCommand::class.java) context.workflowClient .newCreateInstanceCommand() .bpmnProcessId(cmd.bpmnProcessId) .latestVersion() .payload(cmd.payload) .send() .join() } } }
  • 29. >   Let there be code      
  • 30. Now you tell me: Was that cool or what?
  • 31. But wait ... ... there is more
  • 32. Everyone! Take a picture and mail it to: holunda.io@gmail.com
  • 34. What just happened ■ Zeebe Broker does not know workers ■ Workers do not use Zeebe-API ■ Only Orchestrator is connected to Broker ■ Camel routes connect everything
  • 35. What we could do ■ replace file system with messaging infrastructure ■ any camel supported route will work out of the box ■ any program that can write/read the JSON-API can be a worker ■ Test routes by mocking components
  • 36. But wait ... ... ah, no - that was it!