Jmeter middleware processing -RabbitMQ

 

RabbitMQ is to achieve the Advanced Message Queuing Protocol (AMQP) is an open source messaging middleware, which is based on the Erlang language, strong concurrent capacity, performance, and it is currently one of the mainstream message queue middleware.

 

 



 

RabbitMQ installation can refer to the official website (https://www.rabbitmq.com/), Startup Manager service after installing, RabbitMQ provides a powerful management capabilities.

 

 

 

 

 

Jmeter processing using RabbitMQ before, you first need to understand the AMQP protocol provisions of the queue, the queue RabbitMQ supports the following types:

 

 


• Basic queue Simple Queue: a Producer of a Consumer, ActiveMQ function similar to P2P mode • Work queue polling Distribution: Producer correspond to a plurality of Consumer, polling or other algorithms can be used to set the Consumer consume, Producer's message which is one of consumer consumption • Fanout exchange: producers do not send messages to the message queue, but is sent to the switch, the switch is bound to each queue, the message sent by the producer after the switch to the queue, the message is to achieve a more the purpose of consumer spending, the function is similar to ActiveMQ Topic / Subscriber mode • Direct exchange: routing mode, be based on key switches and queue bindings • Topic exchange: wildcard pattern, a consumer queue can have multiple instances of consumers, which only one instance of the message will be received
more commonly used and Direct Exchange FanoutMode, paper as an example of how to use DirectExchange Jmeter handle RabbitMQ messaging middleware. In Jmeter sent using RabbitMQ messaging and consumer ago, we first create a new Direct Exchange console switch in RabbitMQ, the respective queue by Key bindings

 

 


安装JmeterRabbitMQ插件
Jmeter没有内置对RabbitMQ的支持,在使用Jmeter发送和接受RabbitMQ以前,需要首先下载相应插件包编译后放置到Jmeter的lib当中( https://github.com/jlavallee/JMeter-Rabbit-AMQP )安装完插件包以后,新建Jmeter脚本,可以在脚本中看到AMQP Publisher和AMQP Consumer取样器,分别对应AMQP协议的消息发送者和消息接受者

 

 

Jmeter发送RabbitMQ消息

新建AMQP Publisher,因为本示例采用的是Direct Fanout模式,填写完RabbitMQ连接信息以后,在Publisher里需要指定对应的消费者的绑定Key以及交换机

 

 

 

Jmeter接受RabbitMQ消息
新建AMQP Consumer,此处指定RabbitMQ连接信息,交换机名称,类型以及队列名即可(需要和生产者匹配)

 

 

 

运行脚本,查看结果数,此时也可以通过RabbitMQ控制台看到消息发送和接受的情况。

 

 

作  者:Testfan kitty
出  处:微信公众号:自动化软件测试平台
版权说明:欢迎转载,但必须注明出处,并在文章页面明显位置给出文章链接

 

Guess you like

Origin www.cnblogs.com/testfan2019/p/12400581.html