対応する URL で要求を受け入れるように「http インバウンド」を定義したミュール構成ファイルがあります。
今私がしなければならないことは、有効な http インバウンド アドレスのみを受け入れ、他のアドレスを拒否することです。
そこで、「選択」フィルターを適用して、有効な URL を除外しました。(次のように) :
<flow name="abc">
<http:inbound-endpoint address="http://localhost:1212/jcore/abc"
transformer-refs="HttpParams" responseTransformer-refs="JavaObjectToJson"
contentType="application/json" encoding="UTF-8">
</http:inbound-endpoint>
<component class="main.java.com.jcore.abc"/>
<choice>
<when evaluator="header"
expression="INBOUND:http.request.path=/jcore/abc/a">
<vm:outbound-endpoint path="ToSomething"/>
</when>
<when evaluator="header"
expression="INBOUND:http.request.path=/jcore/abc/b">
<vm:outbound-endpoint path="ToSomething"/>
</when>
<otherwise>
<message-properties-transformer>
<add-message-property key="http.status" value="404"/>
</message-properties-transformer>
<expression-transformer>
<return-argument evaluator="string"
expression="{"Exception": "Could not Render the Request.
URL may be wrong"}"/>
</expression-transformer>
</otherwise>
</choice>
</flow>
それは働いています..!!
しかし、私はこのような「フロー」を約30個持っています。そして、このような「選択」フィルターをすべてのフローに適用したいと思います。
注:一致する URL は、その都度変更されます。この場合のように「/abc/a」です。他では違う
したがって、この冗長なコードの多くを記述せずに、パラメーターまたはその他の合計を使用して Spring Bean を作成し、各フローに適用できる方法があるかどうかを知りたかった..??