Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use one RabbitMQ connection + use co-routines #104

Open
angrave opened this issue Sep 28, 2020 · 0 comments
Open

Use one RabbitMQ connection + use co-routines #104

angrave opened this issue Sep 28, 2020 · 0 comments
Assignees

Comments

@angrave
Copy link
Collaborator

angrave commented Sep 28, 2020

TODO: TaskEngine should use one RabbitMQ connection for the whole process not one per task
TODO: Take a deep dive into how this actually working and document it.

It would also be useful to confirm that we are actually using async co-routines and not multiple threads.

TaskEngine does not explicilty create any threads; however it certainly has a main loop that sleeps for a couple of hours, while mulitple message queues are being concurrently services!

We may need to upgrade to the latest RabbitMQ C# client.

And emperically confirm that RabbitMQ C# Implementation with a prefetch count>1 does not implement concurrency using multiple threads.
e.g. alway print out a threadID and print out how many threads are running
e.g. take a deep dive into the C# RabbitMQ source code.

consumer.Received += async (model, ea) =>

_logger.LogInformation("Prefetch concurrency count {0}" , concurrency);

            _channel.QueueDeclare(.... );

            _channel.BasicQos(prefetchSize: 0, prefetchCount: concurrency, global: false);
        }
        var consumer = new EventingBasicConsumer(_channel);
        consumer.Received += async (model, ea) =>
        { ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants