예제 #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            AutoFacConfig.ContainerGenerate();
            KafkaEventProducer.Start(
                ConfigHelper.KafkaBorkerList,
                ConfigHelper.KafkaProducerRequiredAcks);

            consumerGroup = new ConsumerGroup(
                ConfigHelper.KafkaConsumerNumbers,
                ConfigHelper.KafkaConsumerGroupId,
                ConfigHelper.KafkaConsumerTopics,
                ConfigHelper.KafkaBorkerList,
                new PubSubDispatcher <KafkaEventStream>(AutoFacConfig.Container));
            consumerGroup.Start();
        }
예제 #2
0
 protected void Application_End()
 {
     KafkaEventProducer.Stop();
     consumerGroup.Stop();
 }