public HttpOutgoingQueueProcessorTests() { MockLogger = new Mock <ILogger <HttpPushOutgoingQueueProcessor> >(); MockMessageDa = new Mock <IMessageLogDa>(); NebulaContext = new NebulaContext(); NebulaContext.RegisterJobQueue(typeof(MockDelayedQueue), QueueType.Delayed); Interlocked.Increment(ref _portNumber); var baseAddress = $"http://localhost:{_portNumber}"; Parameters = new HttpPushOutgoingQueueParameters { TargetUrl = $"{baseAddress}/endpoint" }; StubHttp = HttpMockRepository.At(baseAddress); JobConfiguration = new JobConfigurationData { MaxBatchSize = 1, MaxConcurrentBatchesPerWorker = 5, IdleSecondsToCompletion = 30, MaxBlockedSecondsPerCycle = 60, MaxTargetQueueLength = 100000, QueueTypeName = QueueType.Redis, Parameters = JsonConvert.SerializeObject(Parameters) }; JobData = new JobData { JobId = "test_job_id", Configuration = JobConfiguration, TenantId = TenantId }; }
public void Initialize(JobData jobData, NebulaContext nebulaContext) { JobData = jobData; Trace.WriteLine($@" Initialization: guid: {Guid} jobId: {JobData.JobId} _transientService1: {_transientService1.Guid}"); }
public NebulaService(IOptions <NebulaConfig> options, IServiceProvider serviceProvider, IOutputChannelDa outputChannelDa) { var nebulaConfig = options?.Value ?? throw new ArgumentNullException(nameof(options)); _serviceProvider = serviceProvider; _outputChannelDa = outputChannelDa; NebulaContext = new NebulaContext(); ConfigureNebulaContext(nebulaConfig); }
public ProcessorRetryTests() { Options = Microsoft.Extensions.Options.Options.Create(retryConfiguration); Processor = new HttpPushOutgoingQueueProcessor(MockLogger.Object, MockMessageDa.Object, Options); NebulaContext.RegisterJobProcessor(Processor, typeof(HttpPushOutgoingQueueStep)); _step = new HttpPushOutgoingQueueStep { Category = "test_category", FailCount = 0, Payload = "test_message" }; }
private static void Main() { Console.WriteLine("Abaci.JobQueue.Worker worker service..."); var nebulaContext = new NebulaContext(); nebulaContext.RegisterJobQueue(typeof(RedisJobQueue <>), QueueType.Redis); nebulaContext.RegisterJobProcessor(typeof(SampleJobProcessor), typeof(SampleJobStep)); nebulaContext.ConnectionConfig("Connections.config"); nebulaContext.StartWorkerService(); Console.WriteLine("Service started. Press ENTER to stop."); Console.ReadLine(); Console.WriteLine("Stopping the serivce..."); nebulaContext.StopWorkerService(); Console.WriteLine("Service stopped, everything looks clean."); }
private static void Main() { Console.WriteLine("Abaci.JobQueue.Worker worker service..."); var nebulaContext = new NebulaContext(); nebulaContext.RegisterJobQueue(typeof(DelayedJobQueue <>), QueueType.Delayed); nebulaContext.RegisterJobQueue(typeof(KafkaJobQueue <>), QueueType.Kafka); // register processor by type // nebulaContext.RegisterJobProcessor(typeof(SampleJobProcessor),typeof(SampleJobStep)); //register processor object nebulaContext.RegisterJobProcessor(new SampleJobProcessor(), typeof(SampleJobStep)); nebulaContext.MongoConnectionString = "mongodb://localhost:27017/SampleJob"; nebulaContext.RedisConnectionString = "localhost:6379"; nebulaContext.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), new KeyValuePair <string, object>("fetch.min.bytes", 1), }; nebulaContext.StartWorkerService(); Console.WriteLine("Service started. Press ENTER to stop."); Console.ReadLine(); Console.WriteLine("Stopping the serivce..."); nebulaContext.StopWorkerService(); Console.WriteLine("Service stopped, everything looks clean."); }
public void Initialize(JobData jobData, NebulaContext nebulaContext) { if (jobData == null) { throw new ArgumentNullException(nameof(jobData), ErrorKeys.ParameterNull); } if (nebulaContext == null) { throw new ArgumentNullException(nameof(nebulaContext), ErrorKeys.ParameterNull); } _jobId = jobData.JobId; _jobQueue = nebulaContext.JobStepSourceBuilder.BuildDelayedJobQueue <HttpPushOutgoingQueueStep>(_jobId); var parametersString = jobData.Configuration?.Parameters; if (string.IsNullOrWhiteSpace(parametersString)) { throw new ArgumentNullException(nameof(jobData.Configuration.Parameters), ErrorKeys.ParameterNull); } _parameters = JsonConvert.DeserializeObject <HttpPushOutgoingQueueParameters>(parametersString); }
public void Initialize(JobData jobData, NebulaContext nebulaContext) { _nebulaContext = nebulaContext; }
public PluginController(RegistryService registryService, NebulaContext context) { _registryService = registryService; _nebulaContext = context; }
public void ClassInit() { Tenant.GetCurrentTenant(); Nebula = new NebulaContext(); ConfigureNebula(); }
public void ClassInit() { Nebula = new NebulaContext(); ConfigureNebula(); }
public UserService(NebulaContext context) { _context = context; }
public TemplateController(RegistryService registryService, NebulaContext context) { _registryService = registryService; _nebulaContext = context; _registryService.Db = _nebulaContext; }