Spring Boot整合RabbitMq 重写confirm不生效

Spring Boot整合RabbitMQ,重写confirmcallback,但是不生效,大神帮忙看下

配置文件:
 

spring.rabbitmq.publisher-confirm-type=correlated
spring.rabbitmq.publisher-returns=true
spring.rabbitmq.template.mandatory=true

队列交换机配置

@Configuration
public class ConfirmConfig {
    public static final String CONFIRM_EXCHANGE_NAME = "confirm.exchange1992";
    public static final String CONFIRM_QUEUE_NAME = "confirm.queue1992";
    public static final String CONFIRM_ROUTING_KEY = "key1992";
    //声明业务 Exchange
    @Bean("confirmExchange")
    public DirectExchange confirmExchange(){
        return ExchangeBuilder.directExchange(CONFIRM_EXCHANGE_NAME).durable(true)
                .build();
    }
    // 声明确认队列
    @Bean("confirmQueue")
    public Queue confirmQueue(){
        return QueueBuilder.durable(CONFIRM_QUEUE_NAME).build();
 

你可能感兴趣的:(rabbitmq,spring,boot)