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.

I was wondering if having one connection, one session, and 10 producers is the recommended way to go or not?

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)?

What's the general guideline of deciding whether to create a new connection or session if I'm always connecting to the same queue?

Thank you and sorry for asking a lot at once.

(Here's a similar question, but it didn't quite answer what I was looking for. Long lived JMS sessions. Is Keeping JMS connections / JMS sessions allways open a bad pratice? )

Edit
Report