Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Inbound endpoints are message sources and can not be parametrized the way you're describing.</p> <p>To achieve your goal, trying a <code>&lt;poll&gt;</code> message source to wrap a <code>foreach</code> that uses <code>http:outbound-endpoint</code> to perform <code>GET</code> (@method) <code>request-response</code> (@exchange-apttern) interactions.</p> <p>The trick is to bring the results for the HTTP calls back through the <code>foreach</code>, which by default do not do it. The following illustrate a potential approach:</p> <pre><code>&lt;flow name="foreachFlow1"&gt; &lt;poll frequency="2000"&gt; &lt;processor-chain&gt; &lt;set-variable variableName="httpResponses" value="#[[]]" /&gt; &lt;foreach collection="#[groovy:['localhost:8082', 'localhost:8083']]"&gt; &lt;http:outbound-endpoint exchange-pattern="request-response" address="http://#[payload]" method="GET" /&gt; &lt;expression-component&gt;httpResponses.add(message.payloadAs(java.lang.String)) &lt;/expression-component&gt; &lt;/foreach&gt; &lt;/processor-chain&gt; &lt;/poll&gt; &lt;logger level="INFO" message="#[httpResponses]" /&gt; &lt;/flow&gt; &lt;!-- Test server stubs --&gt; &lt;flow name="server8082"&gt; &lt;http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8082" /&gt; &lt;set-payload value="This is 8082" /&gt; &lt;/flow&gt; &lt;flow name="server8083"&gt; &lt;http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8083" /&gt; &lt;set-payload value="This is 8083" /&gt; &lt;/flow&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload