Hi Neha,
I looked at the link you gave, but I'm not sure exactly what section you are referring to. Yes, you can have multiple queues and you can have several readers for the same queue.
JMS has several constructs. You use a ConnectionFactory to get a Connection, and the Connection to get the Session. When I was just starting out with JMS (and only wanted a single reader), it seemed like a huge burden to just get to the point where I could read a message. However, the advantage is you can create one Connection, which is guaranteed thread-safe, and use it to create multiple Sessions, which are not guaranteed thread-safe. You can create many readers, each in a separate
thread, to read from the same queue. Each will get a different message. They just share the work of processing.
In the
J2EE world, the easiest thing to do is just create a Message Driven Bean. This bean will handle reading messages from a specific queue, without forcing you to even deal with Connections and Sessions. You can then configure the number of readers just by configuring the number of beans through your app server administration.
Greg