-
Notifications
You must be signed in to change notification settings - Fork 47
How to run RabbitMQ Perf on AOP
ran edited this page May 31, 2020
·
1 revision
-
Download the RabbitMQ Perf https://rabbitmq.github.io/rabbitmq-perf-test/stable/htmlsingle/
-
Start AOP server
-
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);
- Start Perf test:
bin/runjava com.rabbitmq.perf.PerfTest -e my-exchange -r 1000 -u my-queue -p