package com.jianshui.queue.factory;

import com.jianshui.queue.consumer.RedisQueueConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Description 消费者的工厂类，将所有consumer自动加载到factory里，
 * @Author 巩权林
 * @Date 2021-11-25 10:16
 **/

@Service
public class RedisQueueConsumerFactory {

    @Autowired
    private Map<String, RedisQueueConsumer> consumerMap = new ConcurrentHashMap<>();

    public Map<String, RedisQueueConsumer> getConsumerMap() {
        return this.consumerMap;
    }
}
