确认-ack-channel未被调用

时间:2016-04-11 07:15:22

标签: spring-integration spring-amqp

以下是我的配置。如果成功发布到队列,则流不会传递给confirm-ack-channel。任何人都可以建议哪里出错了?

<int-amqp:outbound-channel-adapter channel="fulfillmentOutboundChannel"
                                   routing-key="xyz"
                                   amqp-template="transactionalRabbitTemplate"
                                   confirm-correlation-expression="payload"
                                   confirm-ack-channel="successRespTransformChannel"
                                   confirm-nack-channel="failureRespTransformChannel"
                                   return-channel="failureRespTransformChannel"
                                   mapped-request-headers="*"


        />


<int:channel id="successRespTransformChannel">

    <int:interceptors><int:wire-tap channel="loggerChannel"/></int:interceptors>
</int:channel>

<chain input-channel="successRespTransformChannel">
    <int:header-enricher>
    <error-channel ref="failed-publishing" />
    </int:header-enricher>
    <service-activator id="successResp" expression="@abc.addRequestTracking(payload.id,'success')"/>

</chain>

1 个答案:

答案 0 :(得分:0)

感谢您对Gary的回应。我已经将publish-confirms = true设为如下..

<rabbit:connection-factory id="fufillConnectionFactory"

 connection-factory="rabbitClientConnectionFactory"
                               publisher-confirms="true"
                               publisher-returns="true"/>


    <bean id="rabbitClientConnectionFactory" class="com.rabbitmq.client.ConnectionFactory" >
        <property name="uri" value="${mq.uri}" />
        <property name="requestedHeartbeat" value="30" />
    </bean>