January 2018
Intermediate to advanced
414 pages
10h 29m
English
Let's create another service class; I'm going to name it AdvanceService:
package com.microservices.chapter2import org.springframework.beans.factory.annotation.Valueclass AdvanceService : ServiceInterface { @Value(value = "\${service.message.text}") private lateinit var text: String private var count = 1 override fun getHello(name: String) : String { count++ return "$text $name ($count)" }}
We could add it to the application context as before:
@SpringBootApplicationclass Chapter2Application{ @Bean fun exampleService() : ServiceInterface = ExampleService() @Bean fun advanceService() : ServiceInterface = AdvanceService()}
However, if we run the application now, we get a new error:
field service in com.microservices.chapter2.FirstController ...
Read now
Unlock full access