package com.skr.mdm.rabbitmq;

import com.skr.mdm.constant.RabbitmqBindingKeyConstants;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * rabbitmq配置
 * @author nfq
 * @date 2022-06-13 17:37
 */
@Configuration
public class RabbitMQConfig {

    @Autowired
    private RabbitMQExchange rabbitMQExchange;
    @Autowired
    private RabbitMQQueue rabbitMQQueue;

    @Bean
    public Binding binding() {
        return BindingBuilder.bind(rabbitMQQueue.loginCallBackQueue()).to(rabbitMQExchange.delayedExchange())
                .with(RabbitmqBindingKeyConstants.CLIENT_REGISTER_BINDING_KEY).noargs();
    }

}
