Skip to Main Content

Example: Simple Benchmark

This article provides a straightforward guide to testing the core features of AutoMQ by sending and receiving messages.

After you've successfully installed AutoMQ via the Cluster Deployment on Linux▸ method, you should have a list of Bootstrap Server addresses that looks like this:

192.168.0.1:9092,192.168.0.2:9092

If you opted for a Local Deployment▸, your Bootstrap Server address will be:

broker1:9092,broker2:9092

At each step, ensure you replace the Bootstrap Server address with the one you actually have.

Prerequisites

  • Linux/Mac/Windows Subsystem for Linux

  • Docker

If the container image is downloading slowly, check out Docker Hub Mirror Configuration▸

Create Topic


CMD='docker run --network automq_net automqinc/automq:latest /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --create --topic test-topic --bootstrap-server broker1:9092,broker2:9092"'; [ "$(uname)" = "Linux" ] && eval "sudo $CMD" || eval $CMD

Send Message


CMD='docker run --network automq_net automqinc/automq:latest /bin/bash -c "/opt/kafka/kafka/bin/kafka-producer-perf-test.sh --topic test-topic --num-records=1024000 --throughput 5120 --record-size 1024 --producer-props bootstrap.servers=broker1:9092,broker2:9092"'; [ "$(uname)" = "Linux" ] && eval "sudo $CMD" || eval $CMD

Consume Messages


CMD='docker run --network automq_net automqinc/automq:1.0.4 /bin/bash -c "/opt/kafka/kafka/bin/kafka-consumer-perf-test.sh --topic test-topic --show-detailed-stats --timeout 300000 --messages=1024000 --reporting-interval 1000 --bootstrap-server=broker1:9092,broker2:9092"'; [ "$(uname)" = "Linux" ] && eval "sudo $CMD" || eval $CMD