12 Replies Latest reply on Oct 23, 2012 7:34 PM by gary002g

    Selective message consumption - HOWTO?

    gary002g Newbie

      I've got a web service that processes user's requests and generates messages from them.

      Messages are send to the queue and will be picked up and processed further by a bunch of workers.

      My problem is that generated messages are of different type (currently I have 6 but that number might increase soon).

      Workers are of different type as well. Some can process only one type of message, other can process two or three or all of them.

      My problem is how to make a worker to pick up message that it can process and leave others in the queue to picked by someone else.

       

      I am new to HornetQ and my question might be a very simple one for you, but I reviewed Users Guide and did not find the solution that I like.

      I can certainly create a multiple queues (one for each type of message) but that would be ugly and not extendable.

      I've got an idea to use bitmask to check compatibility of the worker with the message, but how to do it without taking message from the queue and what to do if they aren't compatible??

       

      I am using Java 6 on Linux,  Spring 3.1,  Jetty 8.1 as my container and standalone HornetQ.

      Any tips and pointers will be greatly appreciated. If you can point out to a sample that would be awesome (I haven't had a time to go through all samples yet).