Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Latest commit

 

History

History
 
 

client-go

GO client (producer/consumer) (using Confluent Cloud)

Objective

Quickly test GO example client using Confluent Cloud

How to run

  1. Create $HOME/.ccloud/config

On the host from which you are running Docker, ensure that you have properly initialized Confluent Cloud CLI and have a valid configuration file at $HOME/.ccloud/config.

Example:

$ cat $HOME/.ccloud/config
bootstrap.servers=<BROKER ENDPOINT>
ssl.endpoint.identification.algorithm=https
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username\="<API KEY>" password\="<API SECRET>";
  1. Simply run:
$ ./start.sh

Details of what the script is doing

Building docker image

$ docker build -t vdesabou/go-ccloud-example-docker .

Starting producer

$ docker run -v ${DIR}/librdkafka.config:/tmp/librdkafka.config vdesabou/go-ccloud-example-docker ./producer -f /tmp/librdkafka.config -t testgo

Note: librdkafka.configis generated from your $HOME/.ccloud/config

Starting consumer

$ docker run -v ${DIR}/librdkafka.config:/tmp/librdkafka.config vdesabou/go-ccloud-example-docker ./consumer -f /tmp/librdkafka.config -t testgo