<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Kafka consumer and a web server simultaneously, thread blocking problem in microservice in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/kafka-consumer-and-a-web-server-simultaneously-thread-blocking/m-p/16120#M10333</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;assumptions:&lt;/B&gt; There are microservices behind an api-gateway, they communicate through HTTP synchronously. obviously, each one of those microservices is a web server. now I want my microservice to play as a Kafka producer and "consumer" too. more clearly, my microservice produces events and listens to some topics for another events.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;problem:&lt;/B&gt; It seems traditionally a Kafka consumer use an infinite loop to poll the messages and stay alive (send heart-beats) my process thread is busy by serving host and cant be locked by an infinite loop. is there any way to somehow "listen" to the topic without block the thread just like pulsar listener or rabbit? I prefer not to separate my web server and consumer-processor due to the technical complexity I have to handle in development. may I use Kafka streams in this case? Is there something wrong with my assumptions?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 05:15:37 GMT</pubDate>
    <dc:creator>reza-eghbali</dc:creator>
    <dc:date>2021-08-23T05:15:37Z</dc:date>
    <item>
      <title>Kafka consumer and a web server simultaneously, thread blocking problem in microservice</title>
      <link>https://community.databricks.com/t5/data-engineering/kafka-consumer-and-a-web-server-simultaneously-thread-blocking/m-p/16120#M10333</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;assumptions:&lt;/B&gt; There are microservices behind an api-gateway, they communicate through HTTP synchronously. obviously, each one of those microservices is a web server. now I want my microservice to play as a Kafka producer and "consumer" too. more clearly, my microservice produces events and listens to some topics for another events.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;problem:&lt;/B&gt; It seems traditionally a Kafka consumer use an infinite loop to poll the messages and stay alive (send heart-beats) my process thread is busy by serving host and cant be locked by an infinite loop. is there any way to somehow "listen" to the topic without block the thread just like pulsar listener or rabbit? I prefer not to separate my web server and consumer-processor due to the technical complexity I have to handle in development. may I use Kafka streams in this case? Is there something wrong with my assumptions?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 05:15:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/kafka-consumer-and-a-web-server-simultaneously-thread-blocking/m-p/16120#M10333</guid>
      <dc:creator>reza-eghbali</dc:creator>
      <dc:date>2021-08-23T05:15:37Z</dc:date>
    </item>
  </channel>
</rss>

