Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/disintegrator/benthos-temporal-poc
A PoC to demonstrate integration between Benthos and Temporal. Based on https://github.com/temporalio/money-transfer-project-template-go.
https://github.com/disintegrator/benthos-temporal-poc
Last synced: about 1 month ago
JSON representation
A PoC to demonstrate integration between Benthos and Temporal. Based on https://github.com/temporalio/money-transfer-project-template-go.
- Host: GitHub
- URL: https://github.com/disintegrator/benthos-temporal-poc
- Owner: disintegrator
- License: mit
- Created: 2022-12-02T15:35:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T10:33:18.000Z (almost 2 years ago)
- Last Synced: 2024-11-30T06:49:26.274Z (about 1 month ago)
- Language: Go
- Size: 74.2 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-temporal - Benthos PoC - Start a workflow from a Benthos message. (Go / Samples)
README
# Temporal + Benthos - Proof of Concept
This project demonstrates how Benthos can be used to drive Temporal workflow execution.
## Basic instructions
### Step 0: Temporal Server
Make sure [Temporal Server is running](https://docs.temporal.io/docs/server/quick-install/) first:
```bash
git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker-compose up
```Leave it running. You can use the Temporal Web UI at [localhost:8080](localhost:8080) which is currently in Beta. To use the legacy Temporal Web UI, use the [localhost:8088](localhost:8088) URL instead. There should be no workflows visible in the dashboard right now.
### Step 1: Clone this Repository
In another terminal instance, clone this repo and run this application.
```bash
git clone https://github.com/disintegrator/benthos-temporal-poc.git
cd benthos-temporal-poc
```### Step 2: Run the workflow with Benthos
```bash
go run benthos/main.go --log.level debug -c config.generate.yml
```Observe that Temporal Web reflects the workflow, but it is still in "Running" status. This is because there is no Workflow or Activity Worker yet listening to the `TRANSFER_MONEY_TASK_QUEUE` task queue to process this work.
There is also an alternate pipeline configuration which reads data from a file and uses lines within it to trigger executions. You can run it like so:
```bash
go run benthos/main.go --log.level debug -c config.file.yml
```### Step 3: Run the Worker
In YET ANOTHER terminal instance, run the worker. Notice that this worker hosts both Workflow and Activity functions.
```bash
go run worker/main.go
```Now you can see the workflow run to completion. You can also see the worker polling for workflows and activities in the task queue at [http://localhost:8080/namespaces/default/task-queues/TRANSFER_MONEY_TASK_QUEUE](http://localhost:8080/namespaces/default/task-queues/TRANSFER_MONEY_TASK_QUEUE).
## What Next?
You can run the Workflow code a few more times with `go run benthos/main.go --log.level debug -c config.yml` to understand how it interacts with the Worker and Temporal Server.