how to pass JMSDestination for ActiveMQ in the JMS request headers through JMS point to point sampler using JMeter? - jmeter

We are using JMS point to point sampler for sending messages to different artemis queues in JMeter, while sending the request we need to pass the same queue as used in JNDI properties for JMSDestination in the request headers for JMS point to point sampler.
For expample if we have queues A, B and C. For first execution queue used should be A and JMSDestination in the JMS request headers should be JMSDestination ActiveMQQueue[A], for second execution queue used should be B and JMSDestination in the JMS request headers should be JMSDestination ActiveMQQueue[C], for third execution queue used should be B and JMSDestination in the JMS request headers should be JMSDestination ActiveMQQueue[C]?
We are facing issue only with JMS request headers all other places are reading the queues correctly, any solution for this will be much helpful.
how to pass the parameters in JMS request headers while JMS point to point sampler in JMeter?

I don't think it's possible, at least not with JMS Point-to-Point sampler and not with JMeter 5.5
Here is how it's handled currently:
sb.append("JMSDestination ").append(msg.getJMSDestination()).append('\n');
so you cannot overwrite the value unless you amend JMeter source code or develop your own version of the JMS Point-to-Point sampler

Related

JMeter - IBM MQ - Connections Issue

We have been doing performance testing of an application that uses IBM MQ. Through JMeter we are injecting the payload via a JMS Publisher. However, when running the test it can be observed that the connections from the JMeter threads are not being released. This effects the ability to reach the throughput and test failure due to the accumulation of threads. Is there a better alternative than using the JMS Publisher? Or is there setting there that needs to be enabled in order to release the connection once the request has been sent?
https://www.blazemeter.com/blog/ibm-mq-tutorial - Is this the best practice to implement testing IBM MQ?
What are you trying to achieve? JMeter implements Object Pool Pattern so each JMeter thread (virtual user) creates its own JMS connection and on subsequent iterations of the JMS Publisher sampler the Publisher object is being returned from the pool rather than created from zero.
If this is not something you want (or not how your JMS application acts) and you would like to close the connection after posting a message to queue/topic you can achieve it quite easily using JSR223 PostProcessor and the following Groovy code:
def publisher = sampler.publisher
org.apache.jmeter.protocol.jms.client.ClientPool.removeClient(publisher)
org.apache.commons.io.IOUtils.closeQuietly(publisher, null)
sampler.publisher = null

How to set "KeepAlive" or similar parameter for jmeter Point-to-point sampler to re-use connections?

My Jmeter script has a JMS point-to-point sampler that sends JMS message to an ActiveMQ queue. During the load test we realized that the Jmeter connections to the AMQ were neither getting closed nor were re-used, hence causing connection leak and eventually the messages were refused by the broker. I do not see any option in the sampler to say re-use or close-connection. Whats the way I can achieve this? I would appreciate any alternative to using point to point as well, such as a java sampler which may help achieve the same result.
I expect the JMS connections created by Jmeter are re-used and avoid a connection leak. Any parameter similar to "KeepAlive" in http request available for JMS samplers?
point to point sampler config below
JMS Point to Point Sampler

Sending Blob Messages to ActiveMQ with JMeter

As I am a starter in both programs, I had some research about sending messages to ActiveMQ with using JMS point-to-point sampler in JMeter and what I had is as below.What I want to do is the same thing but with the Blob Messages. How can I configure P2P sampler to be able to do that?

Spring web services, JMS transport and replay-to

I need to send a soap message to a queue and wait for the response into another.
The correlationId in the second one (the response queue) is the message Id in the first the message send to the request queue.
I'd like to use spring-ws but I am out of ideas. Could you please give me some advice or small example?
You can use spring integration like this example https://github.com/snicoll/scratches/blob/master/jms-request-reply/src/main/java/net/nicoll/scratch/spring/boot/jms/sync/JmsRequestReply.java
Or spring jms to do request-reply http://docs.spring.io/spring/docs/current/spring-framework-reference/html/jms.html

How to define listener port?

I'm using a JMeter with JMS Point-to-Point sampler, and I've a MQ queue with listener port 2222 (non standard 1414). JMeter retrieves queue connection details from IBM WebSphere Application Sever by Provider URL, and connection factory class: com.ibm.websphere.naming.WsnInitialContextFactory
My question is: How to define that port number in to JMeter plugin? Because I've got in
JMeter logs messages about trying to create connection to 1414?
Try going to:
Start by adding the sampler JMS Point-to-Point to the Point-to-Point
element (Add --> Sampler --> JMS Point-to-Point). Then, select the JMS
Point-to-Point sampler element in the tree.
and than set the property:
Provider URL tcp://$HOSTNAME:$PORT

Resources