/**
 * Copyright 2019 DH
 * All right reserved.
 * 项目名称: 大恒泰山系统
 * 创建日期:2022/11/15
 */
package org.ts.ddcs.kafkaStream;


import lombok.extern.slf4j.Slf4j;
import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;


import java.util.concurrent.*;

/***
 * Date:2022/11/15
 * Title:文件所属模块（必须填写）
 * Description：对本文件的详细描述，原则上不能少于30字
 * @author dylan
 * @version 1.0
 * Remark：认为有必要的其他信息
 */
@Slf4j
public class KafkaStream {



    private static ThreadFactory KafkaTopologyThreadFactory = new ThreadFactoryBuilder().setNameFormat("kafka-topology-thread-pool-%d").build();
    private static ExecutorService KafkaStreamThreadPool = new ThreadPoolExecutor(4, 8,
            0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(64), KafkaTopologyThreadFactory, new ThreadPoolExecutor.AbortPolicy());


    public void start() {
        KafkaStreamSourceTopology sourceTopology = new KafkaStreamSourceTopology();
        FutureTask<Integer> sourceTask = new FutureTask<>(sourceTopology);
        KafkaStreamThreadPool.execute(sourceTask);

    }
}
