I am trying to run a code sample of Kafka in unity environment and for this reason, I created a consumer client (Code given below).
For future user, here is the process to add Kafka in your Unity3d Project: Actually there is a specific order or folder hierarchy to add dll in your project. (I didn't find any authoritative reference about this if someone found then please share)
Now, you can run my code sample(mentioned in question).
IMP NOTE: After building the player, you have to manually copy the dll files in your Player/Managed/librdkafka folder. You have to create librdkafka folder in managed folder, then paste your dlls.(Again i don't know why it require but if someone found authoritative refrence then share)
If you review the source: https://github.com/confluentinc/confluent-kafka-dotnet/blob/master/src/Confluent.Kafka/Impl/LibRdKafka.cs#L323-L374, confluent.kafka will load librdkafka dynamically, which these dlls:
Either needs to be copied to the same folder where Confluent.Kafka.dll
stays or create a librdkafka folder like this to the same folder:
\---librdkafka
+---x64
| libeay32.dll
| librdkafka.dll
| librdkafkacpp.dll
| libzstd.dll
| msvcp120.dll
| msvcr120.dll
| ssleay32.dll
| zlib.dll
|
\---x86
libeay32.dll
librdkafka.dll
librdkafkacpp.dll
libzstd.dll
msvcp120.dll
msvcr120.dll
ssleay32.dll
zlib.dll