On 06/05/2013 12:00 PM, Subramaniam, Ganapathy wrote:
Can you give me more details ? I am confused between the poller and
the socket.

There will typically be many clients connected to the broker, each using its own socket. At any one time there may be nothing to read on a given socket. The poller is a mechanism to wait for data on a whole set of sockets with a single thread. When any socket in the set has data, the thread then processes that socket. This way the broker can use a fixed (usually small) number of threads to handle a large number of connections.

The poller is waiting for messages on a pipe. I don’t
understand how these two work together. When the broker object is
created, only  n threads of the poller are started. I am confused. So
can you give me an brief overview of what happens when a client
creates a connection and sends a message.

The client opens a socket to the broker and encodes the necessary instructions, including the message data, according to the protocol in use (in this case AMQP). It then writes the encoded data to the socket.

The availability of this data causes one of the worker threads to wake up and process that socket. It reads the data, decodes it to understand the instructions and get the message data and then routes the message as per the instructions.

Does that help?

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to