title: Kafka integration in unity3d throwing Win32Exception error
body: <p>I am trying to run a code sample of <strong>Kafka</strong> in unity environment and for this reason, I created a <strong>consumer</strong> client (Code given below).</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using Confluent.Kafka;
  using Confluent.Kafka.Serialization;
  using System.Text;
  
  public class KafkaConsumer : MonoBehaviour 
  {
      // Use this for initialization
      void Start () 
      {
          /*
           * The consumer application will then pick the messages from the same topic and write them to console output. 
           * The process to create the consumer application is also very simple.
           */
          var config = new Dictionary&lt;string, object&gt;
          {
              { "group.id","JavaInUseGroup" },
              { "bootstrap.servers", "localhost:9092" },
              { "enable.auto.commit", "false" }
          };
  
          using (var consumer = new Consumer&lt;Null, string&gt;(config, null, new StringDeserializer(Encoding.UTF8)))
          {
              consumer.Subscribe(new string[] { "javainuse-topic" });
  
              consumer.OnMessage += (_, msg) =&gt;
              {
                  //Console.WriteLine($"Topic: {msg.Topic} Partition: {msg.Partition} Offset :{msg.Offset} {msg.Value}");
                  Debug.Log($"Topic: {msg.Topic} Partition: {msg.Partition} Offset :{msg.Offset} {msg.Value}");
  
                  consumer.CommitAsync(msg);
              };
  
              while (true)
              {
                  consumer.Poll(100);
              }
          }
      }
  }
  </code></pre>
  
  <p>In order to execute the above code sample I have also added <code>confluent.Kafka dll</code> into my project asset folder. but whenever I run my unity game it throws an <strong>error:Win32Exception</strong>: The specified module could not be found.</p>
  
  <blockquote>
    <p>Rethrow as InvalidOperationException: Error while loading
    librdkafka.dll or its dependencies from Assets/librdkafka.dll. Check
    the directory exists, if not check your deployment process. You can
    also load the library and its dependencies by yourself before any call
    to Confluent.Kafka Confluent.Kafka.Impl.LibRdKafka.Initialize
    (System.String userSpecifiedPath) (at
    &lt;700d5bbe3b974ce5aed001c82b789f6a>:0) Confluent.Kafka.Consumer..ctor
    (System.Collections.Generic.IEnumerable<code>1[T] config) (at
    &lt;700d5bbe3b974ce5aed001c82b789f6a&gt;:0)
    Confluent.Kafka.Consumer</code>2[TKey,TValue]..ctor
    (System.Collections.Generic.IEnumerable<code>1[T] config,
    Confluent.Kafka.Serialization.IDeserializer</code>1[T] keyDeserializer,
    Confluent.Kafka.Serialization.IDeserializer`1[T] valueDeserializer)
    (at &lt;700d5bbe3b974ce5aed001c82b789f6a>:0) KafkaConsumer.Start () (at
    Assets/KafkaConsumer.cs:26)</p>
  </blockquote>
  
  <p>As the error states that there is dependancy problem so i have also copied these dll in assets/librdkafka/x64 folder</p>
  
  <ol>
  <li>librdkafka </li>
  <li><p>librdkafkacpp</p></li>
  <li><p>msvcr120</p></li>
  <li>zlib</li>
  </ol>
  
  <p>Now the problem is, my project get stuck whenever i try to play it.</p>
  
  <p><em>Remember: I have downloaded all these dll through nuget in vs 2017. Then i bring these dll into unity.</em></p>