2 Replies Latest reply on Jan 18, 2008 10:25 AM by kconner

    Aggregator bug?

      Hello, I am playing with org.jboss.soa.esb.actions.Aggregator. I can see that there has been some changes recently. But I thing I have found a bug that has not been found yet.

      There are in org.jboss.soa.esb.actions.Aggregator lines

      ConcurrentHashMap<String, Message> messageMap=null;
       //Get the messageMap with this uuId, or create it if not found
       if (_aggregatedMessageMap.containsKey(uuId)) {
       messageMap = _aggregatedMessageMap.get(uuId);
       } else {
       messageMap = new ConcurrentHashMap<String, Message>();
       }
      


      I think that there should be
      ConcurrentHashMap<String, Message> messageMap=null;
       //Get the messageMap with this uuId, or create it if not found
       synchronized(this)
       if (_aggregatedMessageMap.containsKey(uuId)) {
       messageMap = _aggregatedMessageMap.get(uuId);
       } else {
       messageMap = new ConcurrentHashMap<String, Message>();
       }
       }
      


      Without that change, some messages can be lost when aggregator service has more then one thread.

      Pavel