I am currently working on a priority workflow use case where I have to implement the producer consumer logic. The use case is - Different sets of jobs which are classified into 3 types that go into the blocking queue, and there are 3 threads or a thread group for consuming.
Jobs in the Queue
a1, a2, a3...an, b1,b2,b3...bn c1,c2,c3...cn, d1..., e1.....
Consumer Thread
CT1, CT2, CT3
My problem is how can I co-ordinate this Consumer Thread or Group so that:
CT1 process a1-an jobs
CT2 process b1-bn jobs
CT3 process c1-cn jobs
. . . . and more threads for a new set of jobs.
Please provide any pointers for the approach.