liveBook · Manning

Bootstrap server

As explained in Kafka Streams in Action, Second Edition

bootstrap.servers is the Kafka client configuration containing one or more broker hostname-and-port endpoints used to establish an initial cluster connection.

A bootstrap server is a host-and-port endpoint that a Kafka client uses to establish an initial connection to a broker or Kafka cluster. The bootstrap.servers configuration accepts one endpoint during development or several comma-separated endpoints for production deployments. section 4.2.1 section 6.3.2

Configure the same connection concept across Kafka client types:

  • Set bootstrap.servers for KafkaProducer with a broker endpoint such as localhost:9092. section 4.2.1
  • Set bootstrap.servers for KafkaConsumer; provide either one host:port pair or a comma-separated list. section 4.3
  • Set StreamsConfig.BOOTSTRAP_SERVERS_CONFIG alongside application.id; both properties are required to start a Kafka Streams application. section 6.3.2

Kafka Streams connection

A minimal Streams configuration supplies an application identifier and one bootstrap endpoint: props.put(StreamsConfig.APPLICATION_ID_CONFIG, "yelling_app_id"); props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092"); Replace the single development endpoint with comma-separated broker endpoints when connecting to a production cluster. section 6.3.2 section 4.2.1

props.put(StreamsConfig.APPLICATION_ID_CONFIG, "yelling_app_id");
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");

Inspect the minimal Java properties required to identify a Kafka Streams application and establish its Kafka cluster connection. section 6.3.2

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Defines single and comma-separated host-and-port forms, but does not detail subsequent cluster communication.
Examples
Uses localhost:9092 for development and comma-separated broker endpoints for production producer, consumer, and Streams configurations.
What it assumes
Assumes a reachable broker hostname and port, while teaching the required endpoint configuration from the client setup.
What you can do after
Operate/configure Kafka clients with one or more broker endpoints and supply the required Streams connection property.
How it connects
Connects Kafka clients with brokers, clusters, KafkaProducer, KafkaConsumer, Kafka Streams, and application.id.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.