I would like to have an MDB that fires only after two independent states have been reached. For example:
Event A occurs some time passes Event B occurs MDB onMessage is called as a result of both A and B event occurring A and B events are cleared
So for example if Event B occurs but Event A has not occurred then I do not want the onMessage triggered. Similarly if Event A occurs but Event B has not occurred I do not want the onMessage to fire. I also want Event A and B to be correlated such that when onMessage is fired Events A and B are cleared.
One way to do this would be to have Event A produce a message and the message handler for that would check to see if Event B has occurred but it would have to block and loop until an Event B had fired. The polling scheme seems inefficient.
Functionally this would act like a CyclicBarrier but implemented with messaging.
Any thoughts as to whether or not something like this is possible with MDBs?