A Simple XML-Based Message Server

Message Server Architecture

Steps for receiving a message on the server side

Message Server

  1. Detect a socket connection from the client

  2. Delegate the reading of the socket and the placement of the message into the appropriate queue to the Queue Manager

  3. Free up the receiving port (the Java network API reassigns the port to an available port)

Queue Manager

  1. Reads from the socket to obtain the complete message from the client

  2. Builds a Message object using the byte stream passed by the client

  3. Inspects the object to discover the messageId, queueName, and the command

    1. PUT Command : Place the message on the queue using the queueName specified by the client

    2. GET command : Client to request message retrieval

    3. DEL command : Remove all messages from the queue

  4. Take action based on command specified in the message