2 Replies Latest reply on May 3, 2012 5:51 AM by nicolas duminil

    A question related to the aggregator

    nicolas duminil Expert

      Greetings,

       

      I will try to explain my use case, even if it isn't easy. I have a JMS queue containing object messages of the class A and B, having all a message header used as a correlation-id. Based on this correlation-id, I can group messages such that to associate 0 or more B messages to each A message. No orphan B message should exist.

       

      So the aggregation result should contain onlky A objects, each of them having inside all the associated B objects. But no outer B object in the result.

       

      So I need to define the following aggregation strategy:

       

      1. oldExchange contains A and newExchange contains B or oldExchange contains B and newExchange contains A, then I associate B to A and return oldExchange or newExchange, depending which one contains A;

       

      2. oldExchange contains B and newExchange contains B I don't want to return anything such that to avoid that B objects, orphan or already associated with A object be a part of the result of the aggregation

       

      3. oldExchange contains A and newExchange contains A shouldn't happen but, if it happens I return any of them and log an error.

       

      4. oldExchange is null and newExchange contains B I don't want to return anything as returning null is non-sense and returning newExchange will lead to have B object in the result.

       

      etc ...

       

      So, to resume, is there a way to tell to the aggregator to simply skip some iteration or something like this. Maybe I can filter or split the result of the agregation. Sorry if I'm not clear.

       

      Many thanks in advance.

       

      Kind regards,

       

      Nicolas