https://github.com/salaboy/zeebe-knative-worker
Zeebe KNative Worker for Cloud Events
https://github.com/salaboy/zeebe-knative-worker
Last synced: 14 days ago
JSON representation
Zeebe KNative Worker for Cloud Events
- Host: GitHub
- URL: https://github.com/salaboy/zeebe-knative-worker
- Owner: salaboy
- License: apache-2.0
- Created: 2020-03-07T08:58:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T10:28:39.000Z (about 5 years ago)
- Last Synced: 2025-02-17T19:13:48.415Z (3 months ago)
- Language: Java
- Size: 73.2 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zeebe Knative / Cloud Events Worker
This project focus in providing a bridge between Zeebe + BPMN to Knative and Cloud Events to provide Cloud Events orchestration using Zeebe Workflows.
# Service Task Properties
Properties
- HOST
- TYPE
- MODE:
- EMIT_ONLY:
- WAIT_FOR_CLOUD_EVENT:
- WAIT_TYPE: Cloud Event Type to waitThe worker has two modes:
- EMIT ONLY: It will emit a Cloud Event and complete the Job
- WAIT FOR CLOUD EVENT: It will wait to receive Cloud Event with a specific Type which will be correlated by the workflow and job key to complete the Service Task.
# Endpoints
The worker expose HTTP Endpoints to recieve Cloud Events that can be propagated to workflows.
- / POST - > Receive Cloud Event via HTTP that will map to a Job
- /message POST -> Receive a Cloud Event that will be forwarded as a BPMN Message for an Intermediate Catch Event# Examples
## EMIT and WAIT
> zbctl deploy emit-wait.bpmn --insecure
>
> zbctl create instance EMIT_WAIT --insecure
>
> curl -X POST localhost:8080/ -H "Content-Type: application/json" -H "Ce-Id: 536808d3" -H "Ce-Type: " -H "Ce-Source: curl" -H "Ce-Subject: ::" -d '{"name":"salaboy"}' -v
>## EMIT and CONTINUE:
> zbctl deploy emit-and-continue.bpmn --insecure
> zbctl create instance EMIT_AND_CONTINUE --variables "{\"myVarId\" : \"123\"}" --insecure
> curl -X POST localhost:8080/message -H "Content-Type: application/json" -H "Ce-Id: 536808d3" -H "Ce-Type: Cloud Event Response" -H "Ce-Source: curl" -H "CorrelationKey: 123" -d '{"name":"salaboy"}' -v## TICKETS
Deploy workflow
> zbctl deploy tickets.bpmn --insecureRegister Tickets.Purchase event to Start Workflow
> curl -X POST http://localhost:8080/workflows -H "Content-Type: application/json" -d '{"cloudEventType" : "Tickets.Purchase", "workflowKey" : "2251799813690282"}'Send Tickets.Purchase to start a workflow
> curl -X POST http://localhost:8080/workflow -H "Content-Type: application/json" -H "Ce-Id: 536808d33" -H "Ce-Type: Tickets.Purchase" -H "Ce-Source: curl" -d '{"sessionId":"5" }'