package com.muyu.mqtt.config;

import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.Duration;
import java.util.Collections;
import java.util.Properties;

/**
 * RabbitConfig
 *
 * @author Yangle
 * Date 2024/6/6 15:17
 */
@Configuration
public class RabbitConfig {


    @Bean
    public Queue autoDeleteQueue1() {
        return new Queue("create.topic", true);
    }

    @Bean
    public DirectExchange directExchange() {
        return new DirectExchange("topic.direct");
    }

    @Bean
    public Binding binding(DirectExchange directExchange,
                           Queue autoDeleteQueue1 ) {
        return BindingBuilder.bind(autoDeleteQueue1)
                .to(directExchange)
                .with("protocol-parsing");
    }

}
