Helius
2021-05-27 9a968ba186af5280fcc29cc3eb04412eff204ba7
src/main/java/com/xcong/excoin/configurations/RabbitMqConfig.java
@@ -128,6 +128,9 @@
    public static final String QUEUE_DELAY = "queue.delay";
    public static final String EXCHANGE_DELAY = "exchange.delay";
    public static final String QUEUE_MSG_HISTORY = "queue_msg_history";
    public static final String ROUTING_KEY_MSG_HISTORY = "routing_key_msg_history";
    @Resource
    private ConnectionFactory connectionFactory;
@@ -163,7 +166,7 @@
        params.put("x-dead-letter-exchange", EXCHANGE_DELAY);
        // x-dead-letter-routing-key 声明了这些死信在转发时携带的 routing-key 名称。
        params.put("x-dead-letter-routing-key", ROUTING_KEY_DELAY);
        params.put("x-message-ttl", 6000);
//        params.put("x-message-ttl", 6000);
        return new Queue(QUEUE_DELAY, true, false, false, params);
    }
@@ -183,6 +186,16 @@
    }
    @Bean
    public Queue msgHistoryQueue() {
        return new Queue(QUEUE_MSG_HISTORY);
    }
    @Bean
    public Binding msgHistoryBinding() {
        return BindingBuilder.bind(msgHistoryQueue()).to(defaultExchange()).with(ROUTING_KEY_MSG_HISTORY);
    }
    @Bean
    public Queue testQueue() {
        return new Queue(QUEUE_TEST, true);
    }