apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.38k stars 2.1k forks source link

JMeter point-to-point sampler doesn't allow to provide dynamic values #3437

Open asfimport opened 10 years ago

asfimport commented 10 years ago

juanma.cvega (Bug 57015): The point-to-point sampler in JMeter for request-reply messages doesn't allow to provide parameterized values. All configuration values must be hard coded into the sampler, so any attempt to create dynamic values for the jms broker host for example don't work.

OS: All

asfimport commented 10 years ago

@pmouawad (migrated from Bugzilla): Hello, Can you provide a sample Test plan , describe the expected behaviour vs what you get ?

If possible make Test plan for ActiveMQ. Thanks

asfimport commented 10 years ago

juanma.cvega (migrated from Bugzilla): The test plan provides two user defined variables that are used to specify the broker host and port. Then, inside a thread group, the test tries to change the value of the JMS_BROKER_HOST variable in a bean sampler, providing another string, before running the jms point-to-point sampler. When running the test, it's easy to see in the View Results Tree how an exception is thrown saying the sampler cannot reach the broker in the specified host, that is the one defined in the user defined variables, not in the bean sampler. It can also be checked in the Debug sampler provided that the new value is stored in the user variable.

Created attachment Test Plan.jmx: Test plan example

Test Plan.jmx ````xml false false JMS_BROKER_HOST brokerHost = JMS_BROKER_PORT 61616 = continue false 1 1 1 1412327165000 1412327165000 false vars.put("JMS_BROKER_HOST","anotherBrokerHost"); false false true false ConnectionFactory Q.REQ Q.RPL true true true org.apache.activemq.jndi.ActiveMQInitialContextFactory tcp://${JMS_BROKER_HOST}:${JMS_BROKER_PORT} queue.Q.REQ test.in = queue.Q.RPL jmeter.in = false saveConfig true true true true true true true false true true false false false false false false false false 0 true false saveConfig true true true true true true true false true true false false false false false false false false 0 true ````
asfimport commented 10 years ago

Sebb (migrated from Bugzilla): The provider URL is resolved at configuration time, i.e. before the thread runs the BeanShell Pre-processor.

It is possible to change variables using a Config test element such as the User Defined Variables element.

asfimport commented 10 years ago

juanma.cvega (migrated from Bugzilla): Yes, that way it works. But other elements that provide dynamic ways of changing the value don't work. I've tried using Random Variable element, CSV Data Set Config or Bean Shell sampler and those don't work. The reason for this requirement is to be able to test clustered configurations. Without it, I'm forced to duplicate the test plan, providing a value for each of them.