I want to implement a JMS Queue to ensure that each message is only delivered to one consumer. There will be many different types of consumers on listening to the queue. Messages should have properties set which identify the type of work required and these are used by the consumers selector to ensure that they only get sent work which they can handle.
My question is how can I make sure that when a consumer registers with the Queue as a consumer that they implement a selector to avoid the following scenario.
If I have 3 message types (A, B and C) and 3 consumers (a, b and c) which each consume only 1 message type as follows: a->A b->B c->C then all messages of type A will be sent to 1, all messages of type B will be sent to 2 etc.
I want to prevent someone registering a new consumer (d) which has no selector because this consumer would mean that messages of type A,B,C would now either go to their intended consumer or possibly consumer d.
Alternatively I would like the queue to give preference to consumers which have a selector that matches over a consumer with no selector.
Ps. The list of possible consumers and message types is dynamic and not in my control which I why I don't have a queue for each message type.