Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to test dubbo interface in jmeter

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to test the dubbo interface in jmeter. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.

Open Jmeter

A Test Plan (test plan) is created by default.

Create thread group

Right-click on Test Plan and add-> Thread-> Thread Group

Thread group configuration

If you just test the interface, you can just use the default configuration. These configurations are related to stress testing, which will be explained in another article later.

Add dubbo default configuration

Right-click the thread group and add-> configure components-> Dubbo Config

Configure dubbo default configuration

Here, you need to configure according to the specific circumstances of your project.

Protocol corresponds to the protocol used by dubbo in the project. Here we use the zk protocol.

Address is the address of your registry.

Grouping of Group project configurations

Other on-demand configurations will be fine.

Add Dubbo sampler

Right-click the thread group and add-> Sampler-> Dubbo Sample

Configure the Dubbo sampler

Get a list of interfaces

If you do not want to enter directly, clicking Get Provider List will automatically connect to the zk address configured by Dubbo Config above to get all registered services

Click Get Provider List

Image.png

Determine the prompt

After clicking the button, there will be a prompt that may be time-consuming, regardless of clicking Yes.

Image.png

Get the prompt after completion

Image.png

two。 Select the interface and method to test

Select the interface you want to call

Select in the drop-down box of Interfaces, of course, you can also type directly

Image.png

Select the method you want to call

Select in the Methods drop-down box, of course, you can also enter

Image.png

3. Set parameters

Let's take an interface to determine whether it is a working day or not as an example.

Interface definition

Image.png

Parameter definition

Image.png

Response value definition

Image.png

Add parameter

Click the add button on the right side of Args

Add the fully qualified name of the parameter class in the paramType box. Note that paramType is the parameter type, not the parameter name.

Add the json form of the parameter class you want to pass parameters to paramValue

Running interface

When the configuration is complete, click the green run button on the toolbar

Image.png

After clicking, there will be a prompt for you to save first, Yes directly to find a folder you like, and then click again.

Add View result Tree

After the previous step, the run flashed by, and we certainly don't know what the response interface is unless we check the server log. So configure the result record.

Right-click the thread group and add-> listener-> View the result tree

Run it again, and it is found that the request has been recorded in the view result tree, and the response data is the result of this request. The result of the request has one more class field than the actual return class, because it is a generalization call used, here it tells the type of the response class

This is how to test the dubbo interface in the jmeter shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report