title: How do I use kafka and redis in a laravel project?
body: <p>I have been having problem configuring Kafka and Redis together in Laravel.</p>
  
  <p>I am able to run Redis for the use of in-memory database. So Redis works fine.</p>
  
  <pre><code>$redis = app()-&gt;make('redis');
  return $redis-&gt;get('name1'); // it runs fine returning value of "name1"
  </code></pre>
  
  <p>I am able to configure Kafka in my windows system where I am able to produce and consume messages in terminals.</p>
  
  <p>Successfully configured Rdkafka as php client library and extensions.</p>
  
  <p>The package I am using in Laravel for Kafka is <code>"superbalist/laravel-pubsub": "^3.0", "superbalist/php-pubsub-kafka": "^2.0"</code><a href="https://packagist.org/packages/superbalist/laravel-pubsub" rel="nofollow noreferrer">LINK</a> </p>
  
  <p>The below mentioned code is to subscribe and consume the message</p>
  
  <pre><code>$pubsub = app('pubsub');
  $pubsub-&gt;subscribe('test1', function ($message) {
          var_dump($message); // the code just stuck here 
  });
  </code></pre>
  
  <p>The browser just keeps loading and won't stop. I tried to look into the code within vendors but the response is non understandable. </p>
  
  <p>My ENV as requested by the package</p>
  
  <pre><code>REDIS_HOST=localhost
  REDIS_PASSWORD=null
  REDIS_PORT=6379
  
  PUBSUB_CONNECTION=redis
  
  KAFKA_BROKERS=localhost
  
  GOOGLE_CLOUD_PROJECT_ID=your-project-id-here
  GOOGLE_CLOUD_KEY_FILE=path/to/your/gcloud-key.json
  
  HTTP_PUBSUB_URI=null
  HTTP_PUBSUB_SUBSCRIBE_CONNECTION=redis
  </code></pre>
  
  <p>If the Redis local server and client terminals are closed the error I get</p>
  
  <blockquote>
    <p>Error while reading line from the server  [tcp://localhost:9092]</p>
  </blockquote>
  
  <p>Please let me know if someone have been able to configure them both in laravel.</p>