https://github.com/jwulf/zeebe-zero-scale
A Zeebe Worker for Zero-scale integration with Serverless (AWS / Azure Web Function / OpenWhisk)
https://github.com/jwulf/zeebe-zero-scale
aws aws-lambda lambda microservices orchestration workflow zeebe zero-scale
Last synced: about 1 year ago
JSON representation
A Zeebe Worker for Zero-scale integration with Serverless (AWS / Azure Web Function / OpenWhisk)
- Host: GitHub
- URL: https://github.com/jwulf/zeebe-zero-scale
- Owner: jwulf
- Created: 2019-06-09T11:23:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-08T01:28:40.000Z (almost 3 years ago)
- Last Synced: 2025-03-27T13:46:20.397Z (over 1 year ago)
- Topics: aws, aws-lambda, lambda, microservices, orchestration, workflow, zeebe, zero-scale
- Language: TypeScript
- Homepage: https://zeebe.io
- Size: 174 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zero Scale Zeebe
A Zeebe Worker for integration with Serverless (AWS / Azure Web Function / OpenWhisk) or other JSON-based HTTP APIs. Allows you to run workers at zero-scale (nothing running when there is no work).
OK, it's not zero scale, because you need this one worker running. But it is one worker for multiple task types - not one worker per-task type.
This worker is configured via a JSON file containing a map of task types to REST endpoints.
It polls for configured tasks and invokes remote HTTP endpoints via GET or POST.
This configuration file looks like this:
```JSON
{
"tasks": {
"test-task": {
"url": "http://localhost:3000/getExample?foo=bar&baz=foo",
"method": "get",
"headers": { "Content-Type": "application/json" }
},
"test-task2": {
"url": "http://localhost:3000/postExample",
"method": "post",
"headers": { "X-My-Custom-Header": "woopWoop" }
}
}
}
```
The map is reloaded every 30 seconds, so the task type mapping can be updated.
## Usage
Install dependencies:
```bash
npm i
```
Build:
```bash
npm run build
```
Set the environment variable `ZEEBE_TASK_MAP_FILE` to point to your JSON map (there is an example in the `demo` subdirectory).
Then run `npm start`
## Demo
To run the demo:
- Install dependencies:
```
npm i
npm i -g typescript ts-node
```
- In Terminal 1 - Start a broker:
```
cd demo
docker-compose up
```
- In Terminal 2 - Start the Lambda Emulator REST Server. This server emulates an AWS Lambda / SQS or other endpoint.
```
cd demo
ts-node server.ts
```
- In Terminal 3 - Start the Zero-Scale worker:
```
ZEEBE_TASK_MAP_FILE=../demo/taskmap.json ts-node src/index.ts
```
- In Terminal 4 - start a workflow:
```
cd demo
ts-node start-work.ts
```