I have a requirement, in that I need to divide the whole data or message into two groups i.e. odd and even groups such as M1,M2..M2n represents even number of messages and M1,M3....M2n-1 represents odd number of messages so can anybody suggest me in finding out the solution. Thanks in advance.
You need to give more details about your environment.
If it is a messaging system and the queue is ordered, then order of receiving can help you determine the sequence.
However, you should explain more about the intentions of this division (partition)