Long lived JMS sessions. Is Keeping JMS connections / JMS sessions always opened a bad practice?

前端 未结 5 678
野性不改
野性不改 2021-02-14 08:25

Is keeping JMS connections / sessions / consumer always open a bad practice?

Code draft example:

// app startup code

ConnectionFactory cf = (ConnectionF         


        
5条回答
  •  野的像风
    2021-02-14 08:59

    That is a very common and acceptable practice when dealing with long lived connections. For many JMS servers it is in fact preferable to creating a new connection each time it is needed.

提交回复
热议问题