On 2/27/07, LiXiao2007 <[EMAIL PROTECTED]> wrote:

I would like to write a program with multiple threads. Each thread will
subscribe same mesage queue. There are two ways to do that.
1. Each thread has its own connection and session to the queue.
2. All the threads share same connection and each thread has its own
session.

I don't know which way is better. Any help is greatly appreciated.

You generally only need one connection; just make sure you have many
sessions (typically one per consumer is the best concurrency).

Some folks have found cases when doing lots of durable publishing that
more than one connection can help (maybe one connection for producing
messages is sometimes slightly faster), but for consuming, generally
only one connection is needed.
--

James
-------
http://radio.weblogs.com/0112098/

Reply via email to