vendredi 15 mars 2019

JMeter how to propagate variable to JNDI name Request Queue

As the title suggests, I have problem of successfully filling in the queue names in JMS Point-to-point samplers.

So far, we have been using always the same queue, say jms/queue/input, but recently, we were asked to rename the queue to, let's say jms/queue/fastinput.

That would not be problem, just simple rename-replace. But because we have more environments to run tests against, we need to be able to run the tests with either old or new queues.

Naive solution is to copy the .jmx file and have two separate files for the environments, but that obviously goes against DRY principle and changes in one would have to be tracked to the other.

So I made a settings controller (User Defined Variables) OldSettings and NewSettings with OldSettings filling variable Name: queue; Value: input and NewSettings filling Name: queue; Value: fastinput

In my JMS point to point I then have JNDI name Request queue: jms/queue/${queue} which lead me to believe that the ${queue} would be filled with either input or fastinput, depending on which settings controller was enabled.

But alas, when running the test, Response message: javax.naming.NameNotFoundException: jms/queue/${queue} pops up, showing that the variable has not propagated correctly.

I use the same way to set ProviderURL (declaring in settings, using ${providerURL} in JMS) without any problem.

Any hints towards how to solve the problem would be appreciated, as I am stumped.

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire