简体   繁体   中英

Apache JMeter: How to to send multiple messages using a single JMS Publisher

I am using Apache JMeter for load testing JMS consumer. My test plan is to publish messages directly to JMS Topic from which my MDB will read messages and process.

I have a requirement where each thread sends messages as below:

  1. 1-session messages with unique sessionID.

  2. 10-request messages corresponding to above session. Here each message must have unique requestIDs.

My messages are JSONObjects.

Currently in my Test Plan, I have created 11-JMS Publishers(1-for session and 10-for requests) to send messages. And I ran the test with 200 threads for 10minutes. Maximum time taken was around ~6000ms, which is huge.

Questions:

  1. Is there a way to send multiple messages using a single JMS Publisher ? Note: I can not use "Number of messages to aggregate", as each message should have a unique ID.

  2. Does each JMS Publisher creates a JMS connection, even if all are running as part of a single thread ? If yes, Please suggest how to avoid.

Looking forward to hear from experts.

Thanks in Advance.

Connection is being established for each thread (virtual user) as a part of ThreadListener.streadStarted() method so you can send multiple messages in loop using single JMS Sampler. Connection is being closed when virtual user finishes all samplers execution.

Remember that your test should be realistic and replicate production usage of your system as possible. Each JMeter Thread (virtual user) needs to represent a Publisher so your idea is not to get low time, you need to proof whether your application is capable of processing X messages per unit of time and if not - what prevents it from acting fast enough.

Check out Building a JMS Testing Plan - Apache JMeter article for some tips and tricks with regards to message queues load testing using 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