title: Is it possible to use iterate with call and agregate in the same sequence?
body: <p>I have a scenario in which I need to iterate through an xml and call an endpoint multiple times. After that I need to aggregate the results and use a custom mediator on it. The problem is that all of this has to be done in a single sequence executed by a scheduled task.</p>
  
  <p>Unfortunatelly agregate doesn't seem to wait for the responses. Is there anyway to do this without creating some kind of proxy on the side?</p>
  
  <p>Here's my example code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;sequence name="s_queue_kernel_dev" xmlns="http://ws.apache.org/ns/synapse"&gt;
      &lt;kernel.prepare/&gt;
      &lt;iterate continueParent="true"
          expression="//*[local-name()='request']" id="it1"
          sequential="true" xmlns:ns="http://org.apache.synapse/xsd"&gt;
          &lt;target&gt;
              &lt;sequence&gt;
                  &lt;payloadFactory media-type="xml"&gt;
                      &lt;format&gt;
                          &lt;ser:getEntity xmlns:ser="http://services"&gt;
                              &lt;ser:entityID&gt;$1&lt;/ser:entityID&gt;
                          &lt;/ser:getEntity&gt;
                      &lt;/format&gt;
                      &lt;args&gt;
                          &lt;arg evaluator="xml"
                              expression="./*[local-name()='entityId']" literal="false"/&gt;
                      &lt;/args&gt;
                  &lt;/payloadFactory&gt;
                  &lt;kernel.log&gt;
                      &lt;operation&gt;REQUEST&lt;/operation&gt;
                      &lt;description&gt;{$body}&lt;/description&gt;
                  &lt;/kernel.log&gt;
                  &lt;call blocking="false"&gt;
                      &lt;endpoint key="gov:atena/endpoints/egida/entities.xml"/&gt;
                  &lt;/call&gt;
              &lt;/sequence&gt;
          &lt;/target&gt;
      &lt;/iterate&gt;
      &lt;aggregate id="it1"&gt;
          &lt;completeCondition&gt;
              &lt;messageCount max="-1" min="-1"/&gt;
          &lt;/completeCondition&gt;
          &lt;onComplete expression="//*[local-name()='getEntityReturn']" xmlns:ns="http://org.apache.synapse/xsd"&gt;
              &lt;kernel.log&gt;
                  &lt;operation&gt;RESPONSE&lt;/operation&gt;
                  &lt;description&gt;{$body}&lt;/description&gt;
              &lt;/kernel.log&gt;
          &lt;/onComplete&gt;
      &lt;/aggregate&gt;
      &lt;kernel.log&gt;
          &lt;operation&gt;SUCCESS&lt;/operation&gt;
          &lt;description&gt;{$body}&lt;/description&gt;
      &lt;/kernel.log&gt;
      &lt;kernel.success/&gt;
  &lt;/sequence&gt;</code></pre>
  </div>
  </div>
  </p>