【发布时间】:2016-03-02 17:10:16
【问题描述】:
所以我正在开发一个包含数百个流程的 spring 集成应用程序。所有这些流程基本上代表了应用程序中的一个服务,例如
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"/>
请对此提出任何建议,在此先感谢。
【问题讨论】:
标签: spring spring-integration channel