Skip to main content
Let’s create the producer application by pasting the following Go code into a file named producer.go.
Fill in the appropriate <BOOTSTRAP SERVERS> endpoint and <API KEY> in the bootstrap.servers and sasl.password properties where the producer is instantiated using the kafka.NewProducer method. Compile the producer with the following:
If you get any errors during the build make sure that you initialized the module correctly per the instructions in the previous step.