Wow ok, looking at your code a bit more closely, you are looping 5 times sending the exact same message object 5 times, and using the exact same message object for correlation?? Please don’t do that. Create a new message each time you want to publish.
Also, this sendMessage(JMSHeaderDTO, String)
method that you have implemented… it has all the broker connection logic inside this method? Which would imply to me that each time you want to send a single message, you have to establish a connection. This is very inefficient, the Session to the broker should be connected once at the beginning of the application lifetime, and left up for the duration… pass in the connected Session, or keep it as a variable of some long-lived instance that this method can reference.