Spring JMS Session Usage.

What would be the best practice in the usage of JMS Sessions?
Is it good to reuse a Single Session to handle multiple publishers & subscribers?
What would be the benefits if I go for individual Sessions?

Tagged:

Answers

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 959 admin
    edited January 2020 #2

    Hi @arun_xi_kumar,
    In general we see people scale their JMS apps by creating more JMSConnections, not JMSSessions. There is a single dispatcher thread per JMSConnection so no matter how many JMSSessions are created as part of a single JMSConnection they'd be sharing that same dispatcher thread.

    Also keep in mind the number of cores you'll have available to process messages as having 10 connections won't do you much good if you only have 2 cores to process them.

    You can find this explained in more detail in the threading section of our JMS API docs here: https://docs.solace.com/Solace-JMS-API/Threading.htm

    Hope that helps!

  • hong
    hong Guest Posts: 480 ✭✭✭✭✭

    @arun_xi_kumar Did Marc answer your question? If yes, please accept the answer by clicking "Yes" in the line above "Did this answer the question?".