Tuning MessageProducer
Just as with the Session object, try to reuse a created MessageProducer (within the same thread). It is possible to even reuse a MessageProducer to send messages to different destinations. The trick is to create the producer with a null destination and specify the target destination in the send method instead.
As we briefly mentioned earlier, persisting each incoming message in order to guarantee that they will not be lost in the event of a broker restart or crash will not be positive for performance. It is arguably the most performance-degrading action in messaging. If guaranteed, message delivery is not a requirement for a given scenario; it can be disabled by setting the delivery mode on the relevant MessageProducer to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access