question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scalability with EasyNetQ?

See original GitHub issue

I checked that issue answer:

Does EasyNetQ use a new thread to deal with Subscribe message?` Is using one single thread to consume and one single thread to publish.

It’s not clear to me whether EasyNetQ is actually creating a new thread per subscribe and create a new one per publish, or are they threadpool threads?

How this can be customized or controlled?

We are thinking using an actor framework to process the messages more horizontally.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Plinercommented, May 14, 2019

Hi @ehouarn-perret,

Now there is one publish channel per bus(and we invoke commands to it in single thread). I hope we will introduce pools of publish channels after 4.0.

Merely the same situation with consumer side(multiple channels and single thread) and as I understand there is no limitation to have multithreaded consumer dispatcher, but instead it’s better to offload the handlers to thread pool by Task.Run.

1reaction
sungam3rcommented, May 14, 2019

See this

You can use your own IConsumerDispatcher / IConsumerDispatcherFactory and configure it via DI:

IServiceRegister.Register<IConsumerDispatcherFactory, MyConsumerDispatcherFactory>();

Factory:

internal sealed class MyConsumerDispatcherFactory : IConsumerDispatcherFactory
    {
        private readonly Lazy<IConsumerDispatcher> dispatcher;

        public MyConsumerDispatcherFactory(ConnectionConfiguration configuration)
        {
            if (configuration == null)
                throw new ArgumentNullException(nameof(configuration));

            dispatcher = new Lazy<IConsumerDispatcher>(() => new MyConsumerDispatcher(configuration));
        }

        public IConsumerDispatcher GetConsumerDispatcher() => dispatcher.Value;

        public void OnDisconnected()
        {
            if (dispatcher.IsValueCreated)
                dispatcher.Value.OnDisconnected();
        }

        public void Dispose()
        {
            if (dispatcher.IsValueCreated)
                dispatcher.Value.Dispose();
        }
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

RabbitMQ and .NET with EasyNetQ
Mike Hadlow explains why RabbitMQ makes a compelling solution for building scalable systems, overviewing its exchange-binding-queue routing ...
Read more >
Is this an appropriate design for registering multiple ...
Consume multiple times for the same queue, and then just delegate the jobs to the thread pool, this seemed like a great solution....
Read more >
Issues with multi-threaded usage of EasyNetQ ...
After the app starts ramping up I eventually get a 504 error stating a channel should of been open but it was closed....
Read more >
EasyNetQ – methods for delivering messages - Mariusz Wojcik
In the round-robin delivery, the messages are automatically distributed between all consumers. By manipulating prefetchcount setting you can ...
Read more >
Automated dead-letter queue handling for EasyNetQ [RabbitMQ]
EasyNetQ is designed to make publishing and subscribing with RabbitMQ as easy as possible. of course, you can always use the RabbitMQ client ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found