Така че работя върху приложение за пролетна интеграция, което има стотици потоци. Всички тези потоци основно представляват услуга в приложението като
Report Generation
Customer Search
Get Customer Transactions
Customer Activity Stream
etc.
Исках да валидирам заявките, изпратени до тези потоци (основно проверявайки дали спецификациите на параметрите са изпълнени), така че създадох друг поток отделно за валидиране на заявки, така че всяка заявка, изпратена до горните услуги, първо ще премине през потока за валидиране. Сега се чудя как да отчитам това в потоците на услугата.
Вижте по-долу за подробности.
Поток на валидиране --- >
<int:channel id="svcExeGovernorEntryLoggerChannel"/>
<int:channel id="svcExeGovernorEntryRespChannel" >
<int:interceptors>
<int:wire-tap channel="svcExeGovernorEntryLoggerChannel"/>
</int:interceptors>
</int:channel>
<int:transformer id="serviceExecutionGovernorEntry" ref="serviceExecutionGovernor" method="serviceExecutionEntry" input-channel="svcExeGovernorEntryReqChannel" output-channel="svcExeGovernorEntryRespChannel"/>
<int:logging-channel-adapter id="svcExeGovernorEntryLogger" channel="svcExeGovernorEntryLoggerChannel" logger-name="svcExeGovernor-entry-logger" />
</beans>
Опитах се да използвам мост, както е показано по-долу, но това не работи, изпраща изхода на друга услуга.
<int:channel id="customerCrawlReqChannel">
<int:interceptors>
<int:wire-tap channel="customerCrawlLoggerChannel"/>
</int:interceptors>
</int:channel>
<int:channel id="customerCrawlRespChannel">
<int:interceptors>
<int:wire-tap channel="customerCrawlLoggerChannel"/>
</int:interceptors>
</int:channel>
<int:channel id="customerCrawlLoggerChannel"/>
<int:channel id="customerCrawlResultChannel">
<int:interceptors>
<int:wire-tap channel="customerCrawlLoggerChannel"/>
</int:interceptors>
</int:channel>
<int:channel id="customerCrawlJsonChannel"/>
<http:inbound-gateway id="customerCrawlInboundGateway"
supported-methods="POST"
mapped-request-headers="User-Agent,Content-Type"
request-payload-type="java.lang.String"
path="/service/customercrawl"
reply-timeout="50000"
request-channel="customerCrawlReqChannel"
reply-channel="customerCrawlRespChannel">
</http:inbound-gateway>
<int:bridge input-channel="customerCrawlReqChannel" output-channel="svcExeGovernorEntryReqChannel"/>
<int:transformer id="customerCrawlPrvder" ref="crawlCustomerProviderService" method="crawlCustomer" input-channel="svcExeGovernorEntryRespChannel" output-channel="customerCrawlResultChannel"/>
<int:header-enricher input-channel="customerCrawlResultChannel" output-channel="customerCrawlRespChannel">
<int:header name="Content-Type" expression="'application/json'" />
</int:header-enricher>
<int:logging-channel-adapter
id="customerCrawlLogger"channel="customerCrawlLoggerChannel" logger-
name="customerCrawl-logger"/>
Моля за всякакви предложения около това, благодаря предварително.