1
votes

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

1
What do you mean by "db requests are in ThreadPool" ?UBIK LOAD PACK

1 Answers

1
votes

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 Inter Thread Communication Plugin Manager