Last active
August 29, 2015 14:27
-
-
Save rsogo/68008fa324cf26b7c313 to your computer and use it in GitHub Desktop.
GETのQuery ParameterをForEachで回しながら、ログに出力するサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<mule | |
xmlns="http://www.mulesoft.org/schema/mule/core" | |
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" | |
xmlns:http="http://www.mulesoft.org/schema/mule/http" | |
xmlns:json="http://www.mulesoft.org/schema/mule/json" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/json | |
http://www.mulesoft.org/schema/mule/json/current/mule-json.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/db | |
http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd | |
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/ee/tracking | |
http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd"> | |
<flow name="GetFlow"> | |
<http:listener config-ref="HTTP_Listener_Configuration" path="/output_queries" doc:name="Recieve HTTP request" allowedMethods="GET"> | |
</http:listener> | |
<logger doc:name="Log the payload" level="INFO" message="About to echo #[message.inboundProperties.'http.query.params']"/> | |
<!-- Query Parameter分ループする --> | |
<foreach collection="#[message.inboundProperties.'http.query.params'.entrySet()]" doc:name="For Each"> | |
<!-- payload変数にQuery Parameterの1つ分が入っている --> | |
<logger doc:name="Log the payload" level="INFO" message="payload(#[counter]): #[payload]"/> | |
<logger doc:name="Log the payload" level="INFO" message="payload(#[counter]).key: #[payload.key]"/> | |
<logger doc:name="Log the payload" level="INFO" message="payload(#[counter]).value: #[payload.value]"/> | |
</foreach> | |
</flow> | |
</mule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment