Skip to content

How to run RabbitMQ Perf on AOP

ran edited this page May 31, 2020 · 1 revision
  1. Download the RabbitMQ Perf https://rabbitmq.github.io/rabbitmq-perf-test/stable/htmlsingle/

  2. Start AOP server

  3. Pre-define the exchange and queue

// create connection
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setVirtualHost("default");
connectionFactory.setHost("127.0.0.1");
connectionFactory.setPort(5672);
Connection connection = connectionFactory.newConnection();
Channel channel = connection.createChannel();

String exchange = "my-exchange";
String queue = "my-queue";

// declare exchange and queue
channel.exchangeDeclare(exchange, BuiltinExchangeType.DIRECT, true, false, false, null);
channel.queueDeclare(queue, true, false, false, null);
channel.queueBind(queue, exchange, queue);
  1. Start Perf test:
bin/runjava com.rabbitmq.perf.PerfTest -e my-exchange -r 1000 -u my-queue -p
Clone this wiki locally