title: Enterprise Integration Scatter-Gather across multiple app servers
body: <p>I am looking for a way to aggregate JMS messages sent from multiple application servers, load-balanced via JMS. The problem is basically this:</p>
  
  <p>At the end of our registration form, there exists a container in the http session, and the container has two objects of the same type. Each object needs to be processed, then the container needs to be delivered. Processing an object is resource intensive, so the processing is requested (InOnly, asynchronous) and queued up in OpenMQ. The JMS message is consumed by one of two competing consumers, that are basically duplicate application servers, that also serve up the web requests.</p>
  
  <p>Currently, I just have a hard-coded delay on the container delivery, but with increased traffic there are plenty of delivery failures, since the objects have not finished processing yet. I am using Apache Camel 2.6 and Spring Remoting, and the <a href="http://camel.apache.org/aggregator2.html" rel="nofollow">Camel Aggregator</a> would be ideal, except that each app server must have a duplicate camel context, so they would be competing for the aggregate components.</p>
  
  <p>Perhaps a temporary queue and endpoint for each aggregation, but I'm not sure how to go about doing that, especially the tear-down. What would be the best way to process both objects, then deliver the container?</p>