Skip to content

Instantly share code, notes, and snippets.

@yuvalif
Last active July 21, 2021 18:50
Show Gist options
  • Select an option

  • Save yuvalif/5ab688a286bb0730fec54294a22f678c to your computer and use it in GitHub Desktop.

Select an option

Save yuvalif/5ab688a286bb0730fec54294a22f678c to your computer and use it in GitHub Desktop.
  • run kafka broker
bin/kafka-server-start.sh config/server.properties
  • configure a topic to point to the kafka broker
aws --endpoint-url http://localhost:8000 sns create-topic --name=kafka_hstopic   --attributes='{"push-endpoint": "kafka://localhost", "persistent": "true"}'
  • install hsbench (golang is needed for it)
  • start a vstart cluster
  • create a bucket using hsbench
./hsbench -a 0555b35654ad1656d804 -s h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q== -u http://127.0.0.1:8000 -bp kafka-bucket -r default -m i
  • configure a notification on the bucket and topic
aws --region=default --endpoint-url http://localhost:8000 s3api put-bucket-notification-configuration \
  --bucket kafka-bucket000000000000 \
  --notification-configuration='{"TopicConfigurations": [{"Id": "notif1", "TopicArn": "arn:aws:sns:default::kafka_hstopic", "Events": []}]}'
  • run kafka consumer on the topic
bin/kafka-console-consumer.sh --bootstrap-server=localhost:9092 --topic kafka_hstopic
  • run the hsbech test to make sure that kafka get the messages
./hsbench -a 0555b35654ad1656d804 -s h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q== -u http://127.0.0.1:8000 -bp kafka-bucket -d 10 -t 16 -r default -m p -z 4K
  • take the kafka broker down (if not run as daemon, use Ctr-C)
  • run the hsbech test again
  • start the kafka broker and make sure htat the consumer now get the messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment