Documentation ¶
Overview ¶
Package produce implements a toy producer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Producer ¶
Producer is an example producer to a given topic using given Protobuf message type.
A Producer takes a Kafka client and a topic, and sends one of two types of data:
- A Protobuf message of the given type.
- Invalid data that could not be parsed as any Protobuf message.
This is a toy example, but shows the basics you need to send Protobuf messages to Kafka using franz-go.
func NewProducer ¶
func NewProducer[M proto.Message]( client *kgo.Client, serializer serde.Serializer, topic string, ) *Producer[M]
NewProducer returns a new Producer.
Always use this constructor to construct Producers.
func (*Producer[M]) ProduceInvalid ¶
ProduceInvalid synchronously sends data to the Producer's topic that could never be intererpreted as a Protobuf message.
Click to show internal directories.
Click to hide internal directories.