I need help in designing a function that would model the arrival of the messages in the queue following poisson distribution. I shall be grateful for this kind help.

That's a broad topic with many solutions. For detailed answers, you'll need to ask a more detailed question. You already have a queue in STL, might as well use it. Now "model" and "arrival" mean many different things. Do you want to set up a random number generate with a probability distribution funciton that occasionally "fires" someone into the queue in real time? Is time real or simulated (i.e. if it's an hour between customers, do you run the program for an hour or do you have a pretend clock that is faster than real time, or is there no pause at all and you justprint out "Arrived at 10 pm"? Or is it... etc. etc. Think of all the variaous ways this could be simulated. The question is too vague.

Thanks for the reply, I already got the simulator where I have modelled the arrival of messages and service rates of server using exponential distributed random variable. That is M/M/1 queue. Now I want to work with poisson. Is this exponential distribution is poisson?

You need to read up on your probability distributions before trying to tackle the program. I don't know what your Statistics background is, but if this is new to you, and your phrasing suggests that it is, take a few hours studying up on the Poisson and Exponential distributions and their relationship regarding queues. Google "poisson process+exponential waiting time" and you'll get a bunch of hits. It's hard to model something in a computer program if you don't understand the math behind it.

Thanks I got idea about this. Can you guide me about priority queueing if I send you my code.