Configuration properties for Kafka

Let's see the following application.yml configuration file for a microservice:

spring:  application:    name: customer-service  cloud:    stream:      kafka:        binder:          brokers:          - localhost:9092      bindings:          notification-in:            destination: notification            contentType: application/json          notification-out:            destination: notification            contentType: application/json 

As you can see, this file configures the address of the Kafka server to connect to, and the Kafka topic we use for both the inbound and outbound streams in our code. The contentType properties tell Spring Cloud Stream to send or receive our message objects as strings in the streams.

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.