January 2018
Intermediate to advanced
414 pages
10h 29m
English
But before exploring how we can answer a path request, we need to have a set of customers that we could use, so we could filter them in our new requests.
First, let's modify our application to create a bean that represents our customers:
package com.microservices.chapter3import org.springframework.boot.autoconfigure.SpringBootApplicationimport org.springframework.boot.runApplicationimport org.springframework.context.annotation.Beanimport java.util.concurrent.ConcurrentHashMap@SpringBootApplicationclass Chapter3Application { companion object { val initialCustomers = arrayOf(Customer(1, "Kotlin"), Customer(2, "Spring"), Customer(3, "Microservice")) } @Bean fun customers() = ConcurrentHashMap<Int, Customer>(initialCustomers.associateBy(Customer::id)) ...
Read now
Unlock full access