How can a MDB respond to a more urgent message in time?

Discussions

EJB design: How can a MDB respond to a more urgent message in time?

  1. Suppose there is a MDB processing some kind of business logic.Everytime he receives a message,he perform some operations.And maybe the speed he performs the operations are slower than the speed he receives messages,so there are some un-processed messages in the queue he listens.Now,I want to send a more urgent message to stop this MDB and let all the un-processed messages undo.How can I achieve this?I try to use the priority mechanism provided by JMS.However,I can not get the desired results.
  2. These is a very common problem and have to be dealt with arrangement of multiple MDBs

    Something more of MDB facade needs to be developed.

    client machine
    |
    |
    |
    App server
    |
    |
    |
    Message Manager MDB
    (Decide priority of message and push is on specific pipe)
    Round robin basis
    |
    |
    |
    |
    ________________________________________________
             | |
    | |
    | |
    | Low priority handler MDB
    | (1 to n instances)
    |
    High priority handler MDB
    (1 to 3 instances)


    The low priority beans shall have multiple instances and manager shall put the request in round robin style.

    High priority requests will be any way less in numbers and hence single instance will be enough to work with. Once the high priority request is there manager bean will push it on different pipe than low priority pipe and hence no problem of performance.

    Ofcource one need to balance the push rate and performance factor to decide on bean instances.

    Regards
    Chetan