0

Below is my config. In case of successful posting to queue the flow is not passing to confirm-ack-channel. Can anyone suggest where am going wrong?

<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>
Artem Bilan
  • 113,505
  • 11
  • 91
  • 118

2 Answers2

0

In order to get acks/nacks, in addition to setting up the adapter with confirm-correlation, You also need to enable publisherConfirms on the CachingConnectionFactory.

From the documentation:

For Publisher Confirms (aka Publisher Acknowledgements), the template requires a CachingConnectionFactory that has its publisherConfirms property set to true.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
0

Thanks for your response Gary. I have already made publish-confirms=true as below..

<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>