<p>I am building a SvelteKit application with Kafka Support. I have created a kafka.js file and tested the kafka support with a local kafka setup, which is successful. Now, When I replaced the topic name with a topic that is running in the kafka of our Kubernetes cluster, am not seeing any response.</p>
<p>How do I test this connection that is establishing between Kafka in Kubernetes cluster and the JS web application ? Any hints could be much helpful. Doing just console logs are not helpful so far because kafka itself not getting hit.</p>

codeX
<p>Any two pods deployed in the same namespace can communicate using local service names. So, do the brokers have a <code>Service</code> resource?</p>
<p>For example, assuming you are in <code>namespace: default</code>, and you have <code>kafka-svc</code>, then you'd setup <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer"><code>bootstrap.servers: kafka-svc.svc.cluster.local</code></a>.</p>
<p>You also need to configure Kafka's <code>advertised.listeners</code>. Related blog - <a href="https://strimzi.io/blog/2019/04/17/accessing-kafka-part-1/" rel="nofollow noreferrer">https://strimzi.io/blog/2019/04/17/accessing-kafka-part-1/</a></p>
<p>But this requires <strong>NodeJS</strong> (or other language) <strong>backend</strong>, and not SvelteKit UI (which cannot connect to backend TCP server, only use some HTTP bridge). Your HTTP options would include some custom server, or Confluent REST Proxy, Strimzi Kafka Bridge, etc. But you were <a href="https://stackoverflow.com/questions/75203815/how-to-import-kafkajs-into-a-svelte-page">already told this</a>.</p>
