简体   繁体   中英

In Jmeter , how to wait for a previous sampler(JDBC Request) to finish and then start the new sampler Request(Http request)

So I have a case where I need to do Database operation everytime before the http request sampler. Issues is http request is taking time to execute, and db requests are in ThreadPool. So http request is failing due to that.

Can somebody help me with how to wait for previous sampler to complete and then run the next sampler.

PS Tried with preProcesser also, but same issue

By default JMeter runs samplers upside down (or according to the Logic Controllers ) so if you put HTTP Request sampler under the JDBC Request sampler JMeter will execute JDBC first and HTTP second.

If samplers live in different Thread Groups you still can configure one sampler depend on another with Inter-Thread Communication plugin which is basically a FIFO queue so you can put something into it in 1st Thread Group when the JDBC Request sampler is executed and in the 2nd Thread Group wait for queue size to change and once done - execute the HTTP Request sampler.

You can install Inter-Thread Communication plugin via JMeter Plugins Manager

JMeter 线程间通信插件管理器

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM