Spring integration Spring集成服务激活器被调用两次

Spring integration Spring集成服务激活器被调用两次,spring-integration,Spring Integration,您好,这是我的spring集成配置。当我使用mozilla fire fox rest控制台两次点击我的服务时,它会被调用。例如,如果我点击服务激活器(CA请求激活器)中的某个服务,在某些不可预测的情况下,它会被调用两次。我不知道这是mozilla问题还是配置问题。我尝试使用新窗口,但问题仍然存在。在第一种情况下,我的服务激活器正确返回xml响应,但会立即再次被调用。只有在极少数情况下,它会调用两次 <int:channel id="accountRequest" />

您好,这是我的spring集成配置。当我使用mozilla fire fox rest控制台两次点击我的服务时,它会被调用。例如,如果我点击服务激活器(CA请求激活器)中的某个服务,在某些不可预测的情况下,它会被调用两次。我不知道这是mozilla问题还是配置问题。我尝试使用新窗口,但问题仍然存在。在第一种情况下,我的服务激活器正确返回xml响应,但会立即再次被调用。只有在极少数情况下,它会调用两次

    <int:channel id="accountRequest" />
    <int:channel id="accountResponse" />
    <int:channel id="catRequestChannel" />
    <int:channel id="mataccountRequest" />
    <int:channel id="errorChannel"/>



    <int-http:inbound-gateway id="cwebAccountManagementGateway"     
        supported-methods="GET, POST" 
        request-channel="accountRequest"
        reply-channel="accountResponse" 
        mapped-request-headers="*"      
        mapped-response-headers="*" 
        view-name="/policies" 

        path="/services/{class}/{method}"
        reply-timeout="50000"
error-channel="errorChannel">




        <int-http:header name="serviceClass" expression="#pathVariables.class"/>
        <int-http:header name="serviceMethod" expression="#pathVariables.method"/>

    </int-http:inbound-gateway>


    <int:header-value-router input-channel="accountRequest"
        header-name="state"
        default-output-channel="accountRequest" resolution-required="false">
        <int:mapping value="MA"
            channel="mataccountRequest" />
            <int:mapping value="CA"
            channel="catRequestChannel" />

    </int:header-value-router>

    <int:service-activator id="accountServiceActivator" 
                input-channel="mataccountRequest"
                output-channel="accountResponse" 
                ref="serviceGatewayAdapter" 
                method="requestHandler" 
                send-timeout="60000"/>

        <int:service-activator id="caRequestActivator" 
                input-channel="catRequestChannel"
                output-channel="accountResponse" 
                ref="caServiceGatewayAdapter" 
                method="requestHandler" 
                send-timeout="60000"/>

                 <int:service-activator id="errorRequestActivator" 
                input-channel="errorChannel"
                output-channel="accountResponse" 
                ref="errorGatewayAdapter" 
                method="errorHandler" 
                send-timeout="60000"/>
如果我将邮件编辑为其他值,它将被调用两次 如果我再次更改,它工作正常。我不明白在什么情况下它会被调用两次

您对两个服务激活器使用相同的“requestHandler”,因此很明显它会被调用两次。 您无法知道为处理程序方法调用了哪个激活器,因为调试时只能检查正在调用的处理程序方法。 为了更好地处理这个问题,请为每个服务激活器使用不同的处理程序方法。即使他们正在使用类似的操作,也会更加清晰和易于调试

我建议添加用于记录传入和传出消息的通道拦截器,以便更好地了解情况


干杯

我建议您打开调试日志记录,并通过流跟踪消息。还可以查看您的应用程序服务器访问日志,查看浏览器是否发送了两个请求。
http://localhost:9085/springintegrationsample/create?mail=15999999@mail.com&idNumber=80010600010