0

I want to create multiple kafka Topics run time in my Spark Structured Streaming application. I found that there are various methods available in Java API. But I couldn't find any with Spark Structured Streaming. Please let me know if there is any way available or I need to use java library

My apache Spark version is 2.4.4 and Kafka library dependency is spark-sql-kafka-0-10_2.12

1 Answers1

-1

AFAIK, Spark doesn't create topics.

You can use the same Java APIs you've found before initializing your SparkSession

spark-sql-kafka includes kafka-clients, so you have the AdminClient class available

How to create a Topic in Kafka through Java

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245