Skip to content

Call service.AddKakfa() multiple times #157

Answered by filipeesch
ravi-kotha asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ravi-kotha,

You can call AddKafka multiple times if your application has more than one ServiceCollection/ServiceProvider, but is not usual.

Maybe you can achieve that by calling AddKafka just one time and call the AddProducer multiple times, like:

services.AddKafkaFlowHostedService(kafka => kafka
    .AddCluster(cluster => cluster
    {
        foreach(var producerCOnfig in producersConfig)
            cluster.AddProducer(...)
    })
);

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ravi-kotha
Comment options

@filipeesch
Comment options

@ravi-kotha
Comment options

@ravi-kotha
Comment options

Answer selected by ravi-kotha
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