Beispiel #1
0
        private static void Main()
        {
            // Nebula.RegisterJobQueue(typeof(SampleJobQueue), nameof(SampleJobQueue));
            Nebula.RegisterJobQueue(typeof(RedisJobQueue <>), QueueType.Redis);
            Nebula.RegisterJobProcessor(typeof(SampleJobProcessor), typeof(SampleJobStep));
            Nebula.ConnectionConfig("Connections.config");

            var jobManager = Nebula.GetJobManager();

            CreateJob(jobManager).Wait();
        }
Beispiel #2
0
        private static void Main()
        {
            Nebula.RegisterJobQueue(typeof(DelayedJobQueue <>), QueueType.Delayed);

            Nebula.MongoConnectionString = "mongodb://localhost:27017/SampleJob";
            Nebula.RedisConnectionString = "localhost:6379";
            Nebula.KafkaConfig           = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("bootstrap.servers", "172.30.3.59:9101"),
                new KeyValuePair <string, object>("group.id", "testGroup"),
                new KeyValuePair <string, object>("auto.commit.interval.ms", 5000),
                new KeyValuePair <string, object>("enable.auto.commit", true),
                new KeyValuePair <string, object>("statistics.interval.ms", 60000),
                new KeyValuePair <string, object>("auto.offset.reset", "earliest"),
                new KeyValuePair <string, object>("queue.buffering.max.ms", 1),
                new KeyValuePair <string, object>("batch.num.messages", 1),
                new KeyValuePair <string, object>("fetch.wait.max.ms", 5000)
            };

            _jobManager = Nebula.GetJobManager();

            CreateKafkaJob().Wait();
            //CreateJob().Wait();
        }