Regarding the usage of the Producer, what is the recommended way to set it up.
I can see the API design allows us to use the same Producer instance to send messages to any topics, but I'm not sure if there are any differences like performance or functionality differences under the hood between the two ways.
Tried to search around but missed if this was asked/discussed before.
I suppose similar question can be asked about the Consumer since it can subscribe to multiple topics as well.
2) is the correct way
All producer are independant. So creating multiple producer will create multiple connexions to brokers, and won't send messages in batch automatically (what librdkafka do internally)
If you use serialization, you should create one Producer and then use GetSerializingProducer to get an ISerializingProducer.
For most question about usage/performance, you can also take a loot at edenhill/librdkafka (The C library Confluent.Kafka wrapped)
Most helpful comment
2) is the correct way
All producer are independant. So creating multiple producer will create multiple connexions to brokers, and won't send messages in batch automatically (what librdkafka do internally)
If you use serialization, you should create one Producer and then use GetSerializingProducer to get an ISerializingProducer.
For most question about usage/performance, you can also take a loot at edenhill/librdkafka (The C library Confluent.Kafka wrapped)