forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tyler Rockwood <[email protected]>
- Loading branch information
Showing
3 changed files
with
39 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Redpanda Golang WASM Transform | ||
|
||
To get started you first need to have installed [tinygo]. | ||
|
||
You can get started by modifying the <code>transform.go</code> file | ||
with your logic. | ||
|
||
Once you're ready to test out your transform live you need to: | ||
|
||
1. Make sure you have a container running via <code>rpk container start</code> | ||
1. Run <code>rpk wasm build</code> | ||
1. Run <code>rpk wasm deploy</code> | ||
1. Then use <code>rpk topic produce</code> and <code>rpk topic consume</code> | ||
to see your transformation live! | ||
|
||
⚠️ At the moment the transform you deploy is not persisted to disk, so if you | ||
restart your container you'll need to redeploy. | ||
|
||
[tinygo]: https://tinygo.org/getting-started/install/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/rockwotj/redpanda/src/go/sdk" | ||
) | ||
|
||
func main() { | ||
redpanda.OnTransform(onTransform) | ||
} | ||
|
||
func onTransform(e redpanda.TransformEvent) ([]redpanda.Record, error) { | ||
return []redpanda.Record{e.Record()}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters