在spring集成中,当进程在另一个线程中执行时,我们能从网关返回吗

在spring集成中,当进程在另一个线程中执行时,我们能从网关返回吗,spring,spring-integration,Spring,Spring Integration,您好,我遇到了这样一种情况:当另一个服务定位器中发生一些后端处理时,我希望从spring网关返回响应。我现在的设置是这样的。其中searchGateway是网关,searchResultProcessor需要异步执行 <int:gateway id="searchGateway" service-interface="com.premise.service.integration.SearchGateway" default-request-channel

您好,我遇到了这样一种情况:当另一个服务定位器中发生一些后端处理时,我希望从spring网关返回响应。我现在的设置是这样的。其中searchGateway是网关,searchResultProcessor需要异步执行

<int:gateway id="searchGateway" 
        service-interface="com.premise.service.integration.SearchGateway"
        default-request-channel="search-input" default-reply-channel="search-processed-result" />
    <int:header-enricher input-channel="search-input"
        output-channel="search">
        <int:header name="city" expression="payload.searchRequest.cityName"></int:header>
        <int:header name="servicetype" expression="payload.searchRequest.serviceType"></int:header>
    </int:header-enricher>
    <!-- Webservice callee Integration -->
    <int:splitter id="searchSplitter" ref="searchProductSplitter"
        method="split" input-channel="search" apply-sequence="true"
        output-channel="splittedSearch">
    </int:splitter>
    <!-- Loader or processor -->
    <int:service-activator id="searchProduct"
        input-channel="splittedSearch" ref="searchProcessor" method="process"
        output-channel="search-response">
        <int:poller max-messages-per-poll="4" fixed-delay="1"
            task-executor="searchExecutor"></int:poller>
    </int:service-activator>
    <!-- Aggregator -->
    <int:aggregator input-channel="search-response"
        output-channel="search-aggr-reply" expire-groups-upon-completion="true"
        send-partial-result-on-expiry="false" />
    <int:bridge input-channel="search-aggr-reply" 
        output-channel="save-search-results" />
    <!-- Process Results post comparison and send aggr response -->
    <!-- End Search activator -->
    <int:service-activator input-channel="search-aggr-reply"
        output-channel="search-processed-result" ref="searchResultEnricher"
        method="process" requires-reply="true" />


如果我理解正确,您希望立即从网关方法返回,并在稍后的某个地方获得结果。为此,支持Spring集成


这是您的情况吗?

是的,我知道,但我的情况是,我想从网关返回响应,但想将请求放入另一个队列,该队列在后台以单独的线程继续执行。发布订阅频道是为您提供的,这是一个典型的发布订阅场景。。多谢你,阿泰姆