私は2要求が同時に入って来ている場合、彼らは基本的に が
フローチェーンの後のフロー変数原因となる問題を上書きされます
ません。変数はメッセージに格納されます。すべてのHTTP要求に対して、新しいメッセージが作成されます。
あなたは簡単に次のアプリケーションを自分でそれを試してみることができます:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd">
<flow name="foo">
<http:listener config-ref="user-httpListenerConfig" path="/{test}" doc:name="HTTP"/>
<set-variable variableName="testVariable" value="#[message.inboundProperties['http.uri.params']['test']]" doc:name="testVariable"/>
<foreach collection="#[[1,2,3,4,5,6,7,8,9,0]]" doc:name="For Each">
<logger message="#[flowVars.testVariable]" level="INFO" doc:name="Logger"/>
<scripting:component doc:name="Groovy">
<scripting:script engine="Groovy">
<![CDATA[Thread.sleep(1000)
return payload]]></scripting:script>
</scripting:component>
</foreach>
</flow>
</mule>
これは、このアプリケーションがAnypointStudioで次のようになります。 ![enter image description here](https://i.stack.imgur.com/8zNPW.png)
はただ一つのタブでは、ブラウザからhttp://localhost:8081/foo
を呼び出してhttp://localhost:8081/bar
別のタブであなたのログにはfoo
とbar
の両方が交互に印刷されています。
質問タイトルは誤解を招くものです..どのようにrequest1とrequest2を区別しますか?彼らはどちらも同じ要求ですか? –
それらは単一のエンドポイントから入ってくるでしょう。リクエストの内容は、同時に来る両方の有効なリクエストであると仮定すると、モジュラ・フロー・デザインで使用されるフロー変数を上書きしますか? –
私が尋ねる理由は、それらを差別化できるかどうかです。簡単にフィルタリングできます...必要ではないコンテンツは異なっていなければならず、ヘッダーや他のパラメータのような他のパラメータもそれらを区別することができます –