func EgressFn()

in go/showcase/pkg/showcase/part3/egress.go [34:51]


func EgressFn(ctx statefun.Context, _ statefun.Message) error {
	ctx.SendEgress(statefun.KafkaEgressBuilder{
		Target: KafkaEgressTypeName,
		Topic:  "my-kafka-topic",
		Key:    "my-key",
		Value:  []byte("hello world!"),
	})

	ctx.SendEgress(statefun.KinesisEgressBuilder{
		Target:          KinesisEgressTypeName,
		Stream:          "my-kinesis-stream",
		Value:           []byte("hello world again!"),
		PartitionKey:    "my-partition-key",
		ExplicitHashKey: "my-explicit-hash-key",
	})

	return nil
}