Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带轮询器的Spring集成出站网关_Spring_Spring Integration - Fatal编程技术网

带轮询器的Spring集成出站网关

带轮询器的Spring集成出站网关,spring,spring-integration,Spring,Spring Integration,下面是配置了标头的出站http网关,但在添加轮询器时不会连续触发。它只会被触发一次并停止 <int:inbound-channel-adapter channel="fooinfotrigger.channel" expression="''"> <int:poller fixed-delay="5000"></int:poller> </int:inbound-channel-adapter> <int:channel id="f

下面是配置了标头的出站http网关,但在添加轮询器时不会连续触发。它只会被触发一次并停止

<int:inbound-channel-adapter channel="fooinfotrigger.channel" expression="''">
    <int:poller fixed-delay="5000"></int:poller>
</int:inbound-channel-adapter>

<int:channel id="fooinfo.channel">
    <int:queue capacity="10"/>
</int:channel>

<int:channel id="fooinfotrigger.channel"></int:channel>

<int:chain input-channel="fooinfotrigger.channel" output-channel="fooinfo.channel">       

    <int:header-enricher>
        <int:header name="Authorization" value="...." />
        <int:header name="Content-Type" value="...." />
    </int:header-enricher>

    <int-http:outbound-gateway id="fooHttpGateway"
        url="https://foo.com/v1/services/foo?status=active"
        http-method="GET"
        expected-response-type="java.lang.String"
        charset="UTF-8"
        reply-timeout="5000">
    </int-http:outbound-gateway>

    <int:transformer method="transform" ref="fooResourcesTransformer"/>

</int:chain>

<bean id="fooResourcesTransformer" class="com.foo.FooTransformer" />

固定延迟是一个选项,用于确定前一任务完成后的时间。在您的情况下,
轮询

既然你肯定

触发一次并停止

<int:inbound-channel-adapter channel="fooinfotrigger.channel" expression="''">
    <int:poller fixed-delay="5000"></int:poller>
</int:inbound-channel-adapter>

<int:channel id="fooinfo.channel">
    <int:queue capacity="10"/>
</int:channel>

<int:channel id="fooinfotrigger.channel"></int:channel>

<int:chain input-channel="fooinfotrigger.channel" output-channel="fooinfo.channel">       

    <int:header-enricher>
        <int:header name="Authorization" value="...." />
        <int:header name="Content-Type" value="...." />
    </int:header-enricher>

    <int-http:outbound-gateway id="fooHttpGateway"
        url="https://foo.com/v1/services/foo?status=active"
        http-method="GET"
        expected-response-type="java.lang.String"
        charset="UTF-8"
        reply-timeout="5000">
    </int-http:outbound-gateway>

    <int:transformer method="transform" ref="fooResourcesTransformer"/>

</int:chain>

<bean id="fooResourcesTransformer" class="com.foo.FooTransformer" />
看起来您没有以某种方式在
dealinfo.channel
上完成工作,也没有将控件返回到
TaskScheduler
,因此,也没有将线程释放到其他位置

在那之后,我们真的应该看看并理解你的逻辑,
,以及
dealinfo.channel
上的订户


或者。。。也许你的REST服务根本就没有回复。除此之外,
reply timeout=“5000”

固定延迟是一个选项,用于确定前一任务完成后的时间。在您的情况下,
轮询

既然你肯定

触发一次并停止

<int:inbound-channel-adapter channel="fooinfotrigger.channel" expression="''">
    <int:poller fixed-delay="5000"></int:poller>
</int:inbound-channel-adapter>

<int:channel id="fooinfo.channel">
    <int:queue capacity="10"/>
</int:channel>

<int:channel id="fooinfotrigger.channel"></int:channel>

<int:chain input-channel="fooinfotrigger.channel" output-channel="fooinfo.channel">       

    <int:header-enricher>
        <int:header name="Authorization" value="...." />
        <int:header name="Content-Type" value="...." />
    </int:header-enricher>

    <int-http:outbound-gateway id="fooHttpGateway"
        url="https://foo.com/v1/services/foo?status=active"
        http-method="GET"
        expected-response-type="java.lang.String"
        charset="UTF-8"
        reply-timeout="5000">
    </int-http:outbound-gateway>

    <int:transformer method="transform" ref="fooResourcesTransformer"/>

</int:chain>

<bean id="fooResourcesTransformer" class="com.foo.FooTransformer" />
看起来您没有以某种方式在
dealinfo.channel
上完成工作,也没有将控件返回到
TaskScheduler
,因此,也没有将线程释放到其他位置

在那之后,我们真的应该看看并理解你的逻辑,
,以及
dealinfo.channel
上的订户


或者。。。也许你的REST服务根本就没有回复。独立于此
回复超时=“5000”

同意您的意见。当REST服务因401 Http Status错误而失败时,它将正确地重新触发,但当它以200 Http状态成功时,它不会重新触发。我在这个要点上复制了类似的例子,它也有同样的问题M-M-M。另一方面,测试用例在接收到第一个结果后就退出了。所以,这完全是事实,在测试期间你可能只有一次投票。是的,我同意你的看法。当REST服务因401 Http Status错误而失败时,它将正确地重新触发,但当它以200 Http状态成功时,它不会重新触发。我在这个要点上复制了类似的例子,它也有同样的问题M-M-M。另一方面,测试用例在接收到第一个结果后就退出了。因此,这完全是事实,在测试期间,您可能只有一次投票。