January 2018
Intermediate to advanced
414 pages
10h 29m
English
There is a time in any application that we may need to have a configurable value, something that we can define outside our main code and that can easily change, let's get an understanding through an example, modifying our service class:
package com.microservices.chapter2import org.springframework.beans.factory.annotation.Valueimport org.springframework.stereotype.Service@Serviceclass ExampleService : ServiceInterface { @Value(value = "\${service.message.text}") private lateinit var text: String override fun getHello(name : String) = "$text $name"}
In this change, we have introduced a new variable that has a configurable value using the @Value annotation. This will be filled with the configuration value provided ...
Read now
Unlock full access