elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.05k stars 1.1k forks source link

Sample project to add more thread worker #2935

Open richardmuucyi opened 2 years ago

richardmuucyi commented 2 years ago

Could you provide sample project to add more worker to rebus?

Bus "Rebus 5" setting number of workers to 1 How to increase the number of workers?

tomy2105 commented 2 years ago

I think you need something like:

            services
                .AddElsa(options => options
                    .UseServiceBus(context => {
                        context.Configurer.Transport(......);                       );
                        context.Configurer.Subscriptions(.....);
                        context.Configurer.Options(configurer => {
                            configurer.SetNumberOfWorkers(10);
                            configurer.SetMaxParallelism(10);
                        });
                    })
tomy2105 commented 2 years ago

I believe I found another one :)

                .AddElsa(options =>
                {
                    options
                        ........
                        .UseServiceBus(.........)
                    options.ElsaOptions.ServiceBusOptions.MaxParallelism = 10;
                    options.ElsaOptions.ServiceBusOptions.NumberOfWorkers = 10;
                });

@sfmskywalker can you comment which one is preferred/better? In addition is there better/shorter way to specify ServiceBusOptions other than this?