Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active September 25, 2022 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/3e9cf0a5985a71d32b84cf3b55913eb4 to your computer and use it in GitHub Desktop.
Save garystafford/3e9cf0a5985a71d32b84cf3b55913eb4 to your computer and use it in GitHub Desktop.
# terminal 1: establish an interactive session with the kstreams app container
KSTREAMS_CONTAINER=$(docker container ls --filter name=streaming-stack_kstreams.1 --format "{{.ID}}")
docker logs ${KSTREAMS_CONTAINER} --follow
# terminal 2: establish an interactive session with the kafka container
KAFKA_CONTAINER=$(docker container ls --filter name=streaming-stack_kafka.1 --format "{{.ID}}")
docker exec -it ${KAFKA_CONTAINER} bash
# set environment variables used by jobs
export BOOTSTRAP_SERVERS="localhost:9092"
export INPUT_TOPIC="demo.purchases"
export OUTPUT_TOPIC="demo.running.totals"
# read topics from beginning
kafka-console-consumer.sh \
--topic $INPUT_TOPIC --from-beginning \
--bootstrap-server $BOOTSTRAP_SERVERS
kafka-console-consumer.sh \
--topic $OUTPUT_TOPIC --from-beginning \
--bootstrap-server $BOOTSTRAP_SERVERS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment