Temporal Activity Protobuf Generator Proof of Concept

Temporal Activity Protobuf Generator Proof of Concept

This is a protoc plugin for generating easy to use code for calling and implementing activities.

This is not an official Temporal product

This generator converts protobuf services to easy to use Temporal activity code. Specifically a struct is generated for calling activities and an interface is generated for implementing them.

See the example to see how it can be used.

Usage

This is similar to the gRPC quick start

This requires Go installed, and protoc installed and on the PATH.

If not already installed, the protobuf Go code generator should be installed with:

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

Similarly, this code generator should also be installed with:

go install github.com/cretz/temporal-protoc-gen-go-activity/protoc-gen-go-activity@latest

The Go bin also needs to be on the PATH for those two protoc-gen binaries to be seen by protoc. For example, on Linux:

export PATH="$PATH:$(go env GOPATH)/bin"

Now protoc can be used with both --go_out and --go-activity_out and Temporal code will be written. See the example for a sample of its use.

Additional Notes

  • This is just a proof of concept showing how to use protobuf services. It is not a robust code generator.
  • By default, the Temporal Go SDK will use protobuf JSON serialization for activity request/response. While this is much more human friendly to external readers, it is less resilient to field name changes than traditional binary protobuf serialization which only cares about field numbers. If binary serialization is preferred, the data converter can be set to converter.NewCompositeDataConverter(converter.NewProtoPayloadConverter()) (but this loses fallback converters, so instead one may just want to reorder what's in the default).
  • While the activity struct has synchronous invocations, futures can still be used by still using ExecuteActivity passing the function reference (e.g. workflow.ExecuteActivity(ctx, MyService.MyRPC, req)).
Similar Resources

WIP protobuf support for Gleam ✨

gleam_pb WIP protobuf support for Gleam ✨ Progress Gleam Type generation custom functions that better handle default values stop including unnecessary

Feb 26, 2022

Experiments with pulsar go client and protobuf

How to use proto schema with pulsar go client library Define a .proto file Generate Code using below command: protoc -I=. -I=$GOPATH/src -I=$GOPATH/sr

Nov 15, 2021

Using Wireshark to decrypt TLS gRPC Client-Server protobuf messages

Using Wireshark to decrypt TLS gRPC Client-Server protobuf messages

Using Wireshark to decrypt TLS gRPC Client-Server protobuf messages Sample client server in golang that demonstrates how to decode protobuf messages f

Sep 8, 2022

A Golang protobuf plugin used to generate the necessary interfaces to interact with the database

protoc-gen-go-db-enum This protobuf compiler plugin generates the Valuer and Scanner interfaces for enums defined in the proto files. It is highly bas

Sep 9, 2022

generate protobuf for asynq payload.

protoc-gen-go-asynq generate protobuf for asynq payload. usage 1. install protoc-gen-go-asynq # first install protobuf, then install go get -d google.

Dec 22, 2021

JSON-annotated protobuf definitions for NVD feeds

PROTONVD: Protobuf definitions for NVD Features: Encapsulates all fields in the NIST NVD Vulnerability JSON feeds. JSON annotations in proto definitio

Feb 17, 2022

my fork from google.golang.org/protobuf

Go support for Protocol Buffers This project hosts the Go implementation for protocol buffers, which is a language-neutral, platform-neutral, extensib

Dec 22, 2021

Control your Flipper Zero over Protobuf RPC protocol.

go-flipper Control your Flipper Zero over Protobuf RPC protocol. This library is designed to be transport agnostic, though I've tested it with RPC ove

Dec 17, 2022

Orion - a small lightweight framework written around grpc/protobuf with the aim to shorten time to build microservices at Carousell.

Orion Orion is a small lightweight framework written around grpc/protobuf with the aim to shorten time to build microservices at Carousell. It is deri

Nov 16, 2022
Toy gRPC Tunnel over CloudFlare (Proof of Concept)
Toy gRPC Tunnel over CloudFlare (Proof of Concept)

gun You know what it means. Guide Server Go to your domain in CloudFlare. In "Network" tab, turn on gRPC.

Jan 6, 2023
This is a proof of concept (PoC) for creating a QR code system for proving that one has had a valid vaccination record

TestVac QR Core This is a proof of concept (PoC) for creating a QR code system for proving that one has had a valid vaccination record (FHIR, see http

Nov 27, 2022
Proof of concept project with MQTT and PLC4X imported as Go modules

portal-connect PoC for a edge MQTT client written in Go Basic project setup with PLC4X and Eclipse Paho How to run Install latest Go version https://g

Jan 19, 2022
Goket (Golang Keyboard Event Tree) is a proof-of-concept code for using keyboard events trees for performing operations.

Goket Goket (Golang Keyboard Event Tree) is a proof-of-concept code for using keyboard events trees for performing operations. Its main goal is to all

Jan 3, 2023
Eventproc - A proof-of-concept for exploring event based architecture utilizing bi-directional gRPC streams

eventproc A proof-of-concept for exploring event based architecture utilizing bi

Jan 25, 2022
Protobuf files manager

Prot - protobuf files manager. It application can help your manage protobuf files and generate code based on him. !!! Before use Prot you must install

Jun 22, 2022
Generate types and service clients from protobuf definitions annotated with http rules.

protoc-gen-typescript-http Generates Typescript types and service clients from protobuf definitions annotated with http rules. The generated types fol

Nov 22, 2022
A simple RPC framework with protobuf service definitions

Twirp is a framework for service-to-service communication emphasizing simplicity and minimalism. It generates routing and serialization from API defin

Jan 7, 2023
A Protocol Buffers compiler that generates optimized marshaling & unmarshaling Go code for ProtoBuf APIv2

vtprotobuf, the Vitess Protocol Buffers compiler This repository provides the protoc-gen-go-vtproto plug-in for protoc, which is used by Vitess to gen

Jan 1, 2023
protobuf ではなく JSON でやり取りするファイルを出力する protoc プラグイン

protoc-gen-jsonif proto ファイルから、JSON フォーマットでやりとりする型定義ファイルを出力する protoc プラグインです。 proto ファイルで言語を越えて型定義が出来るのはとても良い しかし protobuf ライブラリを入れるのが面倒 今のプロジェクトには既に

Feb 28, 2022