[jboss-dev-forums] [Design of JBoss ESB] - Aggregator bug?

kadlecp do-not-reply at jboss.com
Fri Jan 18 09:33:39 EST 2008


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


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121292#4121292

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121292



More information about the jboss-dev-forums mailing list