Kafka integration in unity3d throwing Win32Exception error

前端 未结 2 1167
清酒与你
清酒与你 2020-12-21 08:58

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).

相关标签:
2条回答
  • 2020-12-21 09:37

    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)

    1. First paste Confluen.Kafka dll in whatever your folder

    1. Then Make librdkafka folder(Make sure it is created next to confluent.kafka dll) and paste your platform related dll in x64 or x86 Folder

    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)

    0 讨论(0)
  • 2020-12-21 09:54

    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:

    1. libeay32.dll
    2. librdkafka.dll
    3. librdkafkacpp.dll
    4. libzstd.dll
    5. msvcp120.dll
    6. msvcr120.dll
    7. ssleay32.dll
    8. zlib.dll

    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
    
    0 讨论(0)
提交回复
热议问题