Skip to content

How could I have multiple consumers listening to the same queue? #410

Answered by Havret
alejandro-jara asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @alejandro-jara,

If you're using ArtemisNetClient directly, all you need to do is to spin up multiple consumers. If you're using Extensions.DependencyInjection package, it's even simpler. It's just a matter of setting ConcurrentConsumers property to define the desired level of concurrency:

public void ConfigureServices(IServiceCollection services)
{
    services.AddActiveMq(name: "my-artemis-cluster", endpoints: new[] { Endpoint.Create(host: "localhost", port: 5672, "artemis", "artemis") })
        .AddConsumer(address: "a1", RoutingType.Multicast, queue: "q2", new ConsumerOptions { ConcurrentConsumers = 5 }, async (message, consumer, _, _) =>
            {
                Console.W…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alejandro-jara
Comment options

Answer selected by alejandro-jara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants