Shiva Kumar
Shiva Kumar

Reputation: 1

Is there any way we can start the kafka broker and zookeeper in Java Enterprice application without using command prompt to start manually?

I want to know the programing way of starting kafka broker and zookeeper .

I need guidance , i have tried manually starting the kafka broker and kafka zookeeper using these bewlow commands ,

Start the ZooKeeper service

.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

Start the Kafka broker service

.\bin\windows\kafka-server-start.bat .\config\server.properties

Upvotes: 0

Views: 57

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191864

There's libraries such as Testcontainers, EmbeddedKafka, Kafka-unit, Spring-kafka-test, etc that all are meant to be used for integration testing of a Kafka broker.

Otherwise, sounds like you want ProcessBuilder to run any process - Run cmd commands through Java

Ideally, your kafka clients do not run on the same machine as the brokers, however

Upvotes: 1

Related Questions