liveBook · Manning

Application.server

As explained in Kafka Streams in Action, Second Edition

application.server is a Kafka Streams configuration that identifies the host and port where an application instance exposes query access.

application.server identifies the host and port where a Kafka Streams instance exposes query access for Interactive Queries. Configure a unique host:port for every instance sharing an application ID. section 13.2

Use application.server as part of the query-routing setup:

  • Configure the instance’s reachable host and port. section 13.2
  • Build a HostInfo value from the configuration for comparison with query metadata. section 13.2.1
  • Route the query locally when metadata identifies the current host; otherwise call the responsible instance through its REST endpoint. section 13.2.1

Routing a loan-category query

A Spring Boot controller reads application.server, converts its host and port into HostInfo, and compares it with the HostInfo returned by KeyQueryMetadata. Matching hosts query the local state store; different hosts receive the request remotely. section 13.2.1

Listing 13.9 Building a HostInfo object from the application server configuration
@PostConstruct
public void init() {
    String[] parts = applicationServer.split(":");
    thisHostInfo = new HostInfo(parts[0],
                    Integer.parseInt(parts[1]));       #1
}

See the Java initialization that splits application.server into host and port and constructs the current instance’s HostInfo. section 13.2.1

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains endpoint uniqueness, HostInfo construction, metadata comparison, and local-versus-remote routing without detailing network deployment.
Examples
Uses a Spring Boot loan-query controller that parses application.server and routes category queries to the correct Kafka Streams instance.
What it assumes
Assumes familiarity with Kafka Streams instances and state stores while demonstrating endpoint parsing and host-metadata comparison.
What you can do after
Operate/configure a Kafka Streams deployment so query controllers can identify local ownership and contact remote instances.
How it connects
Connects Kafka Streams, Interactive Queries, state stores, KeyQueryMetadata, HostInfo, and REST APIs.

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.