私の場合、localhost:8081/search
に行くと、テキストフィールド(入力)と送信ボタンがある単純なhtmlファイルをロードする必要があります。mule esbの.txtファイルにあるデータベースのクエリの結果を取得するには?
テキストフィールドに件名を入力し、送信ボタンをクリックすると、件名をデータベースに転送してSQLクエリを適用する必要があります。照会結果は.txt
または.html
というファイルで返されます。
しかし、私はテキストファイルを見ると、私は非常に珍しい文字を参照してください。
ラバのこの私のXMLフローコード
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
<db:mysql-config name="MySQL_Configuration" host="localhost" port="3306" user="root" password="Blue1234" database="news" doc:name="MySQL Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="localhost" doc:name="HTTP Request Configuration" port="8081"/>
<file:connector name="file" writeToDirectory="C:\Users\Hersh\Desktop\file" autoDelete="true" streaming="true" validateConnections="true" doc:name="File" />
<flow name="parsetemplateFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/web" doc:name="HTTP"/>
<set-payload value="#[message.inboundProperties.'http.query.params'.q]" doc:name="Set Payload" mimeType="text/html"/>
<db:select config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[select txt from news.nws where sub=#[message.payload]]]></db:parameterized-query>
</db:select>
<response>
<http:static-resource-handler resourceBase="C:\Users\Hersh\Desktop\attach" defaultFile="index.html" doc:name="HTTP Static Resource Handler"/>
</response>
<logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
<set-payload value="#[message.payload]" doc:name="Set Payload"/>
<response>
<file:outbound-endpoint path="C:\Users\Hersh\Desktop\file" outputPattern="output.txt" connector-ref="file" responseTimeout="10000" doc:name="File"/>
</response>
</flow>
</mule>
、これは理想的にはあなたの流れの構造はこのようなものであるべき流れ
私は私のプロジェクトに応募しなければなりません..! あなたはもっと説明することができます.. – hersh
私はconfig.xml plzを作ってくれました。 – scorpion