Is keeping JMS connections / sessions / consumer always open a bad practice?
Code draft example:
// app startup code
ConnectionFactory cf = (ConnectionF
The choice of keeping connection/session/producer/consumer open for long or not should be based on the frequency at which producer/consumer sends/receives messages.
If a producer sends or a consumer receives messages frequently then the connections/sessions/producer/consumer should be kept open. On the other hand if messages send/receive is infrequent then it is not good keeping these JMS objects open will consume system resources like sockets.