title: Relationship between JMS connections, sessions, and producers/consumers
body: <p>I want to send a batch of 20k JMS messages to a same queue. I'm splitting the task up using 10 threads, so each will be processing 2k messages. I don't need transactions.</p>
  
  <p>I was wondering if having one connection, one session, and 10 producers is the recommended way to go or not? </p>
  
  <p>How about if I had one producer shared by all the threads? Would my messages be corrupt or would it be sent out synchronized (giving no performance gain)?</p>
  
  <p>What's the general guideline of deciding whether to create a new connection or session if I'm always connecting to the same queue?</p>
  
  <p>Thank you and sorry for asking a lot at once.</p>
  
  <p>(Here's a similar question, but it didn't quite answer what I was looking for. <a href="https://stackoverflow.com/questions/274051/long-lived-jms-sessions-is-keeping-jms-connections-jms-sessions-allways-open-a">Long lived JMS sessions. Is Keeping JMS connections / JMS sessions allways open a bad pratice?</a> )</p>