package org.jeecg.boot.starter.rabbitmq.exchange;

import org.springframework.amqp.core.CustomExchange;

import java.util.HashMap;

public class DelayExchangeBuilder {
    public static final String DEFAULT_DELAY_EXCHANGE = "jeecg.delayed.exchange";
    public static final String DELAY_EXCHANGE = "jeecg.direct.exchange";

    public static CustomExchange buildExchange() {
        HashMap<String, Object> args = new HashMap<String, Object>();
        args.put("x-delayed-type", "direct");
        return new CustomExchange(DEFAULT_DELAY_EXCHANGE, "x-delayed-message", true, false, args);
    }
}