diff --git a/01.framework-introductions/.DS_Store b/01.framework-introductions/.DS_Store index ed563281..c241a7ff 100644 Binary files a/01.framework-introductions/.DS_Store and b/01.framework-introductions/.DS_Store differ diff --git a/01.framework-introductions/jpa-in-10-steps/jpa-in-10-steps-all-code.md b/01.framework-introductions/jpa-in-10-steps/jpa-in-10-steps-all-code.md index 322559b1..2529e1a0 100644 --- a/01.framework-introductions/jpa-in-10-steps/jpa-in-10-steps-all-code.md +++ b/01.framework-introductions/jpa-in-10-steps/jpa-in-10-steps-all-code.md @@ -56,7 +56,7 @@ JpaBaseConfiguration#transactionManager matched: org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/01.framework-introductions/jpa-in-10-steps/pom.xml b/01.framework-introductions/jpa-in-10-steps/pom.xml index fe279885..0e591f1b 100644 --- a/01.framework-introductions/jpa-in-10-steps/pom.xml +++ b/01.framework-introductions/jpa-in-10-steps/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/01.framework-introductions/jpa-in-10-steps/readme.md b/01.framework-introductions/jpa-in-10-steps/readme.md index 56d2a9f0..c4c03807 100644 --- a/01.framework-introductions/jpa-in-10-steps/readme.md +++ b/01.framework-introductions/jpa-in-10-steps/readme.md @@ -75,7 +75,7 @@ JpaBaseConfiguration#transactionManager matched: org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/01.framework-introductions/jpa-in-10-steps/step21.md b/01.framework-introductions/jpa-in-10-steps/step21.md index 71b3f642..8e67a356 100644 --- a/01.framework-introductions/jpa-in-10-steps/step21.md +++ b/01.framework-introductions/jpa-in-10-steps/step21.md @@ -68,7 +68,7 @@ JpaBaseConfiguration#transactionManager matched: org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE @@ -451,7 +451,7 @@ JpaBaseConfiguration#transactionManager matched: org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/01.framework-introductions/jpa-in-10-steps/step22.md b/01.framework-introductions/jpa-in-10-steps/step22.md index afdb99a9..15fe558d 100644 --- a/01.framework-introductions/jpa-in-10-steps/step22.md +++ b/01.framework-introductions/jpa-in-10-steps/step22.md @@ -68,7 +68,7 @@ JpaBaseConfiguration#transactionManager matched: org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/01.framework-introductions/jpa-in-10-steps/step23.md b/01.framework-introductions/jpa-in-10-steps/step23.md index 05f7cdf0..3e3d0b3b 100644 --- a/01.framework-introductions/jpa-in-10-steps/step23.md +++ b/01.framework-introductions/jpa-in-10-steps/step23.md @@ -59,7 +59,7 @@ JpaBaseConfiguration#transactionManager matched: org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/01.framework-introductions/springboot-in-10-steps/pom.xml b/01.framework-introductions/springboot-in-10-steps/pom.xml index ec0eb6d7..3213cd11 100644 --- a/01.framework-introductions/springboot-in-10-steps/pom.xml +++ b/01.framework-introductions/springboot-in-10-steps/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/01.framework-introductions/springboot-in-10-steps/readme.md b/01.framework-introductions/springboot-in-10-steps/readme.md index 95a38ae3..21b049b1 100644 --- a/01.framework-introductions/springboot-in-10-steps/readme.md +++ b/01.framework-introductions/springboot-in-10-steps/readme.md @@ -63,7 +63,7 @@ http://localhost:8080/books => Few hardcoded books org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE @@ -250,7 +250,7 @@ public class SpringbootIn10StepsApplication { ```properties #logging.level.org.springframework = DEBUG -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- diff --git a/02.restful-web-services/backup01-after-creating-project.md b/02.restful-web-services/backup01-after-creating-project.md index 3791ba59..b5b4c62e 100644 --- a/02.restful-web-services/backup01-after-creating-project.md +++ b/02.restful-web-services/backup01-after-creating-project.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.0.RELEASE diff --git a/02.restful-web-services/backup01-after-creating-project.zip b/02.restful-web-services/backup01-after-creating-project.zip index dfeeeef2..a91e5db8 100644 Binary files a/02.restful-web-services/backup01-after-creating-project.zip and b/02.restful-web-services/backup01-after-creating-project.zip differ diff --git a/02.restful-web-services/backup02-after-hello-world-path-param.md b/02.restful-web-services/backup02-after-hello-world-path-param.md index 3b58ab9b..11bada64 100644 --- a/02.restful-web-services/backup02-after-hello-world-path-param.md +++ b/02.restful-web-services/backup02-after-hello-world-path-param.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE diff --git a/02.restful-web-services/backup02-after-hello-world-path-param.zip b/02.restful-web-services/backup02-after-hello-world-path-param.zip index 8a90dc8d..0250ce53 100644 Binary files a/02.restful-web-services/backup02-after-hello-world-path-param.zip and b/02.restful-web-services/backup02-after-hello-world-path-param.zip differ diff --git a/02.restful-web-services/backup03-after-two-retrieve-user-services.md b/02.restful-web-services/backup03-after-two-retrieve-user-services.md index 98e6cfb3..6888650e 100644 --- a/02.restful-web-services/backup03-after-two-retrieve-user-services.md +++ b/02.restful-web-services/backup03-after-two-retrieve-user-services.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -335,6 +335,7 @@ public class UserResource { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false ``` --- diff --git a/02.restful-web-services/backup03-after-two-retrieve-user-services.zip b/02.restful-web-services/backup03-after-two-retrieve-user-services.zip index ef17d55f..92bd57b6 100644 Binary files a/02.restful-web-services/backup03-after-two-retrieve-user-services.zip and b/02.restful-web-services/backup03-after-two-retrieve-user-services.zip differ diff --git a/02.restful-web-services/backup04-basic-create-service.md b/02.restful-web-services/backup04-basic-create-service.md index f0d94ea4..2b6007c7 100644 --- a/02.restful-web-services/backup04-basic-create-service.md +++ b/02.restful-web-services/backup04-basic-create-service.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -359,6 +359,7 @@ public class UserResource { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false ``` --- diff --git a/02.restful-web-services/backup04-basic-create-service.zip b/02.restful-web-services/backup04-basic-create-service.zip index d7b0846b..94a37490 100644 Binary files a/02.restful-web-services/backup04-basic-create-service.zip and b/02.restful-web-services/backup04-basic-create-service.zip differ diff --git a/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.md b/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.md index 6deb88f5..337904e9 100644 --- a/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.md +++ b/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -480,6 +480,7 @@ public class UserResource { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false ``` --- diff --git a/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.zip b/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.zip index 36fccaf4..36f660e6 100644 Binary files a/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.zip and b/02.restful-web-services/backup05-after-creating-delete-method-on-user-resource.zip differ diff --git a/02.restful-web-services/backup06-after-implementing-validation.md b/02.restful-web-services/backup06-after-implementing-validation.md index b492359e..896add0c 100644 --- a/02.restful-web-services/backup06-after-implementing-validation.md +++ b/02.restful-web-services/backup06-after-implementing-validation.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -496,6 +496,7 @@ public class UserResource { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false ``` --- diff --git a/02.restful-web-services/backup06-after-implementing-validation.zip b/02.restful-web-services/backup06-after-implementing-validation.zip index 0f56e219..d3711904 100644 Binary files a/02.restful-web-services/backup06-after-implementing-validation.zip and b/02.restful-web-services/backup06-after-implementing-validation.zip differ diff --git a/02.restful-web-services/backup06-z-content-negotiation.md b/02.restful-web-services/backup06-z-content-negotiation.md index bf8e93d9..7cf7a8bc 100644 --- a/02.restful-web-services/backup06-z-content-negotiation.md +++ b/02.restful-web-services/backup06-z-content-negotiation.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -246,6 +246,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -275,9 +276,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -294,9 +295,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -307,17 +307,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -559,6 +552,7 @@ public class UserResource { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false ``` --- diff --git a/02.restful-web-services/backup06-z-content-negotiation.zip b/02.restful-web-services/backup06-z-content-negotiation.zip deleted file mode 100644 index 2a45873f..00000000 Binary files a/02.restful-web-services/backup06-z-content-negotiation.zip and /dev/null differ diff --git a/02.restful-web-services/backup07-improving-documentation-with-swagger.md b/02.restful-web-services/backup07-improving-documentation-with-swagger.md index beff813a..0c3fff95 100644 --- a/02.restful-web-services/backup07-improving-documentation-with-swagger.md +++ b/02.restful-web-services/backup07-improving-documentation-with-swagger.md @@ -20,7 +20,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -257,6 +257,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -286,9 +287,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -305,9 +306,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -318,17 +318,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -669,6 +662,7 @@ public interface UserApiDocumentationConfig { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false ``` --- @@ -738,7 +732,7 @@ public class RestfulWebServicesApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -975,6 +969,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -1004,9 +999,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -1023,9 +1018,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -1036,17 +1030,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -1340,6 +1327,7 @@ public class UserResource { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false ``` --- diff --git a/02.restful-web-services/backup07-improving-documentation-with-swagger.zip b/02.restful-web-services/backup07-improving-documentation-with-swagger.zip index 4230e994..847f9067 100644 Binary files a/02.restful-web-services/backup07-improving-documentation-with-swagger.zip and b/02.restful-web-services/backup07-improving-documentation-with-swagger.zip differ diff --git a/02.restful-web-services/backup08-completed-filtering.md b/02.restful-web-services/backup08-completed-filtering.md index fd4947a2..597fb718 100644 --- a/02.restful-web-services/backup08-completed-filtering.md +++ b/02.restful-web-services/backup08-completed-filtering.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -376,6 +376,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -405,9 +406,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -424,9 +425,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -437,17 +437,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -741,8 +734,9 @@ public class UserResource { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- diff --git a/02.restful-web-services/backup08-completed-filtering.zip b/02.restful-web-services/backup08-completed-filtering.zip index 4a09e2a8..fef1cb60 100644 Binary files a/02.restful-web-services/backup08-completed-filtering.zip and b/02.restful-web-services/backup08-completed-filtering.zip differ diff --git a/02.restful-web-services/backup09-completed-versioning.md b/02.restful-web-services/backup09-completed-versioning.md index 1047747e..c00f7a5e 100644 --- a/02.restful-web-services/backup09-completed-versioning.md +++ b/02.restful-web-services/backup09-completed-versioning.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -376,6 +376,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -405,9 +406,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -424,9 +425,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -437,17 +437,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -893,8 +886,9 @@ public class PersonVersioningController { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- diff --git a/02.restful-web-services/backup09-completed-versioning.zip b/02.restful-web-services/backup09-completed-versioning.zip index e199409c..c0d5e591 100644 Binary files a/02.restful-web-services/backup09-completed-versioning.zip and b/02.restful-web-services/backup09-completed-versioning.zip differ diff --git a/02.restful-web-services/backup09-z-completed-security.md b/02.restful-web-services/backup09-z-completed-security.md index d19cbaf6..12e3ccd1 100644 --- a/02.restful-web-services/backup09-z-completed-security.md +++ b/02.restful-web-services/backup09-z-completed-security.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -43,10 +43,10 @@ spring-boot-starter-web - + org.springframework.boot @@ -381,6 +381,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -410,9 +411,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -429,9 +430,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -442,17 +442,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -898,10 +891,11 @@ public class PersonVersioningController { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false management.security.enabled=true -security.user.name=username -security.user.password=password +spring.security.user.name=username +spring.security.user.password=password ``` --- diff --git a/02.restful-web-services/backup09-z-completed-security.zip b/02.restful-web-services/backup09-z-completed-security.zip index 1a3f6e0e..13c22bcd 100644 Binary files a/02.restful-web-services/backup09-z-completed-security.zip and b/02.restful-web-services/backup09-z-completed-security.zip differ diff --git a/02.restful-web-services/backup10-configure-jpa-and-repository.md b/02.restful-web-services/backup10-configure-jpa-and-repository.md index 1adff9a6..a308ccbf 100644 --- a/02.restful-web-services/backup10-configure-jpa-and-repository.md +++ b/02.restful-web-services/backup10-configure-jpa-and-repository.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -43,10 +43,10 @@ spring-boot-starter-web - + org.springframework.boot @@ -381,6 +381,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -410,9 +411,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -429,9 +430,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -442,17 +442,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -1010,11 +1003,11 @@ public class PersonVersioningController { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false -management.security.enabled=false -security.basic.enabled=false -security.user.name=username -security.user.password=password +management.endpoints.web.exposure.include=* +spring.security.user.name=username +spring.security.user.password=password spring.jpa.show-sql=true spring.h2.console.enabled=true ``` diff --git a/02.restful-web-services/backup10-configure-jpa-and-repository.zip b/02.restful-web-services/backup10-configure-jpa-and-repository.zip index 8f92ecf0..22b9c625 100644 Binary files a/02.restful-web-services/backup10-configure-jpa-and-repository.zip and b/02.restful-web-services/backup10-configure-jpa-and-repository.zip differ diff --git a/02.restful-web-services/backup11-added-create-post-resource.md b/02.restful-web-services/backup11-added-create-post-resource.md index 0dda3c1a..de2372eb 100644 --- a/02.restful-web-services/backup11-added-create-post-resource.md +++ b/02.restful-web-services/backup11-added-create-post-resource.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -43,10 +43,10 @@ spring-boot-starter-web - + org.springframework.boot @@ -381,6 +381,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -410,9 +411,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -429,9 +430,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -442,17 +442,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -1124,11 +1117,11 @@ public class PersonVersioningController { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false -management.security.enabled=false -security.basic.enabled=false -security.user.name=username -security.user.password=password +management.endpoints.web.exposure.include=* +spring.security.user.name=username +spring.security.user.password=password spring.jpa.show-sql=true spring.h2.console.enabled=true ``` diff --git a/02.restful-web-services/backup11-added-create-post-resource.zip b/02.restful-web-services/backup11-added-create-post-resource.zip index 241a650c..1344d7f9 100644 Binary files a/02.restful-web-services/backup11-added-create-post-resource.zip and b/02.restful-web-services/backup11-added-create-post-resource.zip differ diff --git a/02.restful-web-services/backup12-migrated-to-jpa.md b/02.restful-web-services/backup12-migrated-to-jpa.md index 9c91a4ae..d36d521b 100644 --- a/02.restful-web-services/backup12-migrated-to-jpa.md +++ b/02.restful-web-services/backup12-migrated-to-jpa.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -43,10 +43,10 @@ spring-boot-starter-web - + org.springframework.boot @@ -381,6 +381,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -410,9 +411,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -429,9 +430,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -442,17 +442,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -1000,11 +993,11 @@ public class PersonVersioningController { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false -management.security.enabled=false -security.basic.enabled=false -security.user.name=username -security.user.password=password +management.endpoints.web.exposure.include=* +spring.security.user.name=username +spring.security.user.password=password spring.jpa.show-sql=true spring.h2.console.enabled=true ``` diff --git a/02.restful-web-services/backup12-migrated-to-jpa.zip b/02.restful-web-services/backup12-migrated-to-jpa.zip index 92d25bc5..00707833 100644 Binary files a/02.restful-web-services/backup12-migrated-to-jpa.zip and b/02.restful-web-services/backup12-migrated-to-jpa.zip differ diff --git a/02.restful-web-services/pom.xml b/02.restful-web-services/pom.xml index d374e2a0..e3061321 100644 --- a/02.restful-web-services/pom.xml +++ b/02.restful-web-services/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -36,10 +36,10 @@ spring-boot-starter-web - + org.springframework.boot diff --git a/02.restful-web-services/readme.md b/02.restful-web-services/readme.md index 10e3ae19..d18ae568 100644 --- a/02.restful-web-services/readme.md +++ b/02.restful-web-services/readme.md @@ -89,7 +89,7 @@ We will help you install - http://localhost:8080/filtering - http://localhost:8080/filtering-list - Actuator - - http://localhost:8080/application + - http://localhost:8080/actuator - Versioning - http://localhost:8080/v1/person - http://localhost:8080/v2/person @@ -334,7 +334,7 @@ foreign key (user_id) references user; org.springframework.boot spring-boot-starter-parent - 2.0.0.M2 + 2.0.0.RELEASE @@ -356,10 +356,10 @@ foreign key (user_id) references user; spring-boot-starter-web - + org.springframework.boot @@ -694,6 +694,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -723,9 +724,9 @@ public class HelloWorldController { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } @@ -742,9 +743,8 @@ import java.util.Locale; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -755,17 +755,10 @@ public class RestfulWebServicesApplication { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } ``` --- @@ -1437,11 +1430,11 @@ public class PersonVersioningController { ```properties logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false -management.security.enabled=false -security.basic.enabled=false -security.user.name=username -security.user.password=password +management.endpoints.web.exposure.include=* +spring.security.user.name=username +spring.security.user.password=password spring.jpa.show-sql=true spring.h2.console.enabled=true ``` diff --git a/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/RestfulWebServicesApplication.java b/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/RestfulWebServicesApplication.java index 2888d589..70c82015 100644 --- a/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/RestfulWebServicesApplication.java +++ b/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/RestfulWebServicesApplication.java @@ -5,9 +5,8 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; @SpringBootApplication public class RestfulWebServicesApplication { @@ -18,15 +17,8 @@ public static void main(String[] args) { @Bean public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); + AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(Locale.US); return localeResolver; } - - @Bean - public ResourceBundleMessageSource messageSource() { - ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasename("messages"); - return messageSource; - } } diff --git a/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/helloworld/HelloWorldController.java b/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/helloworld/HelloWorldController.java index 2bfbdbe4..d383dce7 100644 --- a/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/helloworld/HelloWorldController.java +++ b/02.restful-web-services/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/helloworld/HelloWorldController.java @@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; @@ -33,9 +34,9 @@ public HelloWorldBean helloWorldPathVariable(@PathVariable String name) { } @GetMapping(path = "/hello-world-internationalized") - public String helloWorldInternationalized( - @RequestHeader(name="Accept-Language", required=false) Locale locale) { - return messageSource.getMessage("good.morning.message", null, locale); + public String helloWorldInternationalized() { + return messageSource.getMessage("good.morning.message", null, + LocaleContextHolder.getLocale()); } } diff --git a/02.restful-web-services/src/main/resources/application.properties b/02.restful-web-services/src/main/resources/application.properties index 111f7575..9fd55fb8 100644 --- a/02.restful-web-services/src/main/resources/application.properties +++ b/02.restful-web-services/src/main/resources/application.properties @@ -1,8 +1,8 @@ logging.level.org.springframework = info +#This is not really needed as this is the default after 2.0.0.RELEASE spring.jackson.serialization.write-dates-as-timestamps=false -management.security.enabled=false -security.basic.enabled=false -security.user.name=username -security.user.password=password +management.endpoints.web.exposure.include=* +spring.security.user.name=username +spring.security.user.password=password spring.jpa.show-sql=true spring.h2.console.enabled=true \ No newline at end of file diff --git a/03.microservices/.DS_Store b/03.microservices/.DS_Store index 6cc41169..c2f17fc0 100644 Binary files a/03.microservices/.DS_Store and b/03.microservices/.DS_Store differ diff --git a/03.microservices/currency-conversion-service/pom.xml b/03.microservices/currency-conversion-service/pom.xml index d04f82dc..5fd8f0cb 100644 --- a/03.microservices/currency-conversion-service/pom.xml +++ b/03.microservices/currency-conversion-service/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -22,7 +22,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -33,7 +33,7 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign @@ -53,12 +53,12 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon diff --git a/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionServiceApplication.java b/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionServiceApplication.java index 1cac3694..0088964e 100644 --- a/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionServiceApplication.java +++ b/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionServiceApplication.java @@ -3,10 +3,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableFeignClients("com.in28minutes.microservices.currencyconversionservice") @EnableDiscoveryClient @@ -17,8 +18,8 @@ public static void main(String[] args) { } @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); + public Sampler defaultSampler() { + return Sampler.ALWAYS_SAMPLE; } } diff --git a/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyExchangeServiceProxy.java b/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyExchangeServiceProxy.java index 8da0bbf9..171ac86e 100644 --- a/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyExchangeServiceProxy.java +++ b/03.microservices/currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyExchangeServiceProxy.java @@ -1,6 +1,6 @@ package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/03.microservices/currency-exchange-service/pom.xml b/03.microservices/currency-exchange-service/pom.xml index 3b792bff..0be42b5b 100644 --- a/03.microservices/currency-exchange-service/pom.xml +++ b/03.microservices/currency-exchange-service/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -22,7 +22,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -32,7 +32,7 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud diff --git a/03.microservices/currency-exchange-service/src/main/java/com/in28minutes/microservices/currencyexchangeservice/CurrencyExchangeServiceApplication.java b/03.microservices/currency-exchange-service/src/main/java/com/in28minutes/microservices/currencyexchangeservice/CurrencyExchangeServiceApplication.java index b13b9a21..13656990 100644 --- a/03.microservices/currency-exchange-service/src/main/java/com/in28minutes/microservices/currencyexchangeservice/CurrencyExchangeServiceApplication.java +++ b/03.microservices/currency-exchange-service/src/main/java/com/in28minutes/microservices/currencyexchangeservice/CurrencyExchangeServiceApplication.java @@ -3,9 +3,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableDiscoveryClient public class CurrencyExchangeServiceApplication { @@ -15,8 +16,8 @@ public static void main(String[] args) { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } diff --git a/03.microservices/limits-service/pom.xml b/03.microservices/limits-service/pom.xml index 87150feb..9a251277 100644 --- a/03.microservices/limits-service/pom.xml +++ b/03.microservices/limits-service/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -22,7 +22,7 @@ UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -34,7 +34,7 @@ org.springframework.cloud - spring-cloud-starter-hystrix + spring-cloud-starter-netflix-hystrix diff --git a/03.microservices/netflix-eureka-naming-server/pom.xml b/03.microservices/netflix-eureka-naming-server/pom.xml index 7c238800..2409b12a 100644 --- a/03.microservices/netflix-eureka-naming-server/pom.xml +++ b/03.microservices/netflix-eureka-naming-server/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -22,7 +22,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -32,7 +32,7 @@ org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server org.springframework.boot diff --git a/03.microservices/netflix-zuul-api-gateway-server/pom.xml b/03.microservices/netflix-zuul-api-gateway-server/pom.xml index 93db4965..90fff618 100644 --- a/03.microservices/netflix-zuul-api-gateway-server/pom.xml +++ b/03.microservices/netflix-zuul-api-gateway-server/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -22,18 +22,18 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul diff --git a/03.microservices/netflix-zuul-api-gateway-server/src/main/java/com/in28minutes/microservices/netflixzuulapigatewayserver/NetflixZuulApiGatewayServerApplication.java b/03.microservices/netflix-zuul-api-gateway-server/src/main/java/com/in28minutes/microservices/netflixzuulapigatewayserver/NetflixZuulApiGatewayServerApplication.java index d76a485e..df016ada 100644 --- a/03.microservices/netflix-zuul-api-gateway-server/src/main/java/com/in28minutes/microservices/netflixzuulapigatewayserver/NetflixZuulApiGatewayServerApplication.java +++ b/03.microservices/netflix-zuul-api-gateway-server/src/main/java/com/in28minutes/microservices/netflixzuulapigatewayserver/NetflixZuulApiGatewayServerApplication.java @@ -4,9 +4,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication @@ -17,7 +18,7 @@ public static void main(String[] args) { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } diff --git a/03.microservices/readme.md b/03.microservices/readme.md index e7d0b93f..5b3cfad0 100644 --- a/03.microservices/readme.md +++ b/03.microservices/readme.md @@ -94,7 +94,7 @@ You will learn | Application | URL | | ------------- | ------------- | -| Limits Service | http://localhost:8080/limits POST -> http://localhost:8080/application/refresh| +| Limits Service | http://localhost:8080/limits POST -> http://localhost:8080/actuator/refresh| |Spring Cloud Config Server| http://localhost:8888/limits-service/default http://localhost:8888/limits-service/dev | | Currency Converter Service - Direct Call| http://localhost:8100/currency-converter/from/USD/to/INR/quantity/10| | Currency Converter Service - Feign| http://localhost:8100/currency-converter-feign/from/EUR/to/INR/quantity/10000| @@ -104,6 +104,19 @@ You will learn | Zipkin | http://localhost:9411/zipkin/ | | Spring Cloud Bus Refresh | http://localhost:8080/bus/refresh | +## Zipkin Installation + +Quick Start Page +- https://zipkin.io/pages/quickstart + +Downloading Zipkin Jar +- https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec + +Command to run +``` +RABBIT_URI=amqp://localhost java -jar zipkin-server-2.5.2-exec.jar +``` + ## VM Argument -Dserver.port=8001 @@ -155,7 +168,7 @@ spring.cloud.config.failFast=true org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -163,7 +176,7 @@ spring.cloud.config.failFast=true UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -174,7 +187,7 @@ spring.cloud.config.failFast=true org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign @@ -194,12 +207,12 @@ spring.cloud.config.failFast=true org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -439,10 +452,11 @@ package com.in28minutes.microservices.currencyconversionservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableFeignClients("com.in28minutes.microservices.currencyconversionservice") @EnableDiscoveryClient @@ -453,8 +467,8 @@ public class CurrencyConversionServiceApplication { } @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); + public Sampler defaultSampler() { + return Sampler.ALWAYS_SAMPLE; } } @@ -466,7 +480,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -535,7 +549,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -543,7 +557,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -553,7 +567,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud @@ -704,9 +718,10 @@ package com.in28minutes.microservices.currencyexchangeservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableDiscoveryClient public class CurrencyExchangeServiceApplication { @@ -716,8 +731,8 @@ public class CurrencyExchangeServiceApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } @@ -872,7 +887,7 @@ limits-service.maximum=222 ```properties limits-service.minimum=8 limits-service.maximum=888 -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -895,7 +910,7 @@ management.security.enabled=false org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -903,7 +918,7 @@ management.security.enabled=false UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -915,7 +930,7 @@ management.security.enabled=false org.springframework.cloud - spring-cloud-starter-hystrix + spring-cloud-starter-netflix-hystrix @@ -1129,7 +1144,7 @@ public class LimitsServiceApplication { spring.application.name=limits-service spring.cloud.config.uri=http://localhost:8888 spring.profiles.active=qa -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -1174,7 +1189,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1182,7 +1197,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1192,7 +1207,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server org.springframework.boot @@ -1338,7 +1353,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1346,18 +1361,18 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul @@ -1456,9 +1471,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication @@ -1469,8 +1485,8 @@ public class NetflixZuulApiGatewayServerApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } ``` @@ -1572,7 +1588,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -1580,7 +1596,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -1735,7 +1751,7 @@ public class SpringCloudConfigServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1743,7 +1759,7 @@ public class SpringCloudConfigServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/spring-cloud-config-server/pom.xml b/03.microservices/spring-cloud-config-server/pom.xml index 8f481759..137cf9cd 100644 --- a/03.microservices/spring-cloud-config-server/pom.xml +++ b/03.microservices/spring-cloud-config-server/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -22,7 +22,7 @@ UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 diff --git a/03.microservices/step01.md b/03.microservices/step01.md index 50fdd342..26e4adf1 100644 --- a/03.microservices/step01.md +++ b/03.microservices/step01.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step01.zip b/03.microservices/step01.zip index e3411ce7..4cc306a7 100644 Binary files a/03.microservices/step01.zip and b/03.microservices/step01.zip differ diff --git a/03.microservices/step03.md b/03.microservices/step03.md index d4e90458..69750fbc 100644 --- a/03.microservices/step03.md +++ b/03.microservices/step03.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step03.zip b/03.microservices/step03.zip index a00e21f0..14ebf665 100644 Binary files a/03.microservices/step03.zip and b/03.microservices/step03.zip differ diff --git a/03.microservices/step08.md b/03.microservices/step08.md index 7f7b9f2a..f1fbca7b 100644 --- a/03.microservices/step08.md +++ b/03.microservices/step08.md @@ -45,7 +45,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -53,7 +53,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -307,7 +307,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -315,7 +315,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step08.zip b/03.microservices/step08.zip index 86936504..1dd251b3 100644 Binary files a/03.microservices/step08.zip and b/03.microservices/step08.zip differ diff --git a/03.microservices/step09.md b/03.microservices/step09.md index 15f6ff78..3785c396 100644 --- a/03.microservices/step09.md +++ b/03.microservices/step09.md @@ -45,7 +45,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -53,7 +53,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -305,7 +305,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -313,7 +313,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step09.zip b/03.microservices/step09.zip index 64f1fdd7..fbff1f09 100644 Binary files a/03.microservices/step09.zip and b/03.microservices/step09.zip differ diff --git a/03.microservices/step11.md b/03.microservices/step11.md index 17ee7c3d..b1cc1f9e 100644 --- a/03.microservices/step11.md +++ b/03.microservices/step11.md @@ -44,7 +44,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -52,7 +52,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -305,7 +305,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -313,7 +313,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step11.zip b/03.microservices/step11.zip index c89e3b7a..cd9328a7 100644 Binary files a/03.microservices/step11.zip and b/03.microservices/step11.zip differ diff --git a/03.microservices/step17.md b/03.microservices/step17.md index daa2b1bd..faa529bc 100644 --- a/03.microservices/step17.md +++ b/03.microservices/step17.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -355,7 +355,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -363,7 +363,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -616,7 +616,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -624,7 +624,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step17.zip b/03.microservices/step17.zip index b49ee043..09b3c4c0 100644 Binary files a/03.microservices/step17.zip and b/03.microservices/step17.zip differ diff --git a/03.microservices/step20.md b/03.microservices/step20.md index 82d72661..88b47ef9 100644 --- a/03.microservices/step20.md +++ b/03.microservices/step20.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -324,7 +324,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -332,7 +332,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -656,7 +656,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -664,7 +664,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -917,7 +917,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -925,7 +925,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step20.zip b/03.microservices/step20.zip index 247a04f9..6e12dbf5 100644 Binary files a/03.microservices/step20.zip and b/03.microservices/step20.zip differ diff --git a/03.microservices/step23.md b/03.microservices/step23.md index fa485c2c..4e42f26c 100644 --- a/03.microservices/step23.md +++ b/03.microservices/step23.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -44,12 +44,12 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -305,7 +305,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -371,7 +371,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -379,7 +379,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -703,7 +703,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -711,7 +711,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -964,7 +964,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -972,7 +972,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step23.zip b/03.microservices/step23.zip index 5afe78a6..6e93556c 100644 Binary files a/03.microservices/step23.zip and b/03.microservices/step23.zip differ diff --git a/03.microservices/step25.md b/03.microservices/step25.md index 27691f16..3f6d4197 100644 --- a/03.microservices/step25.md +++ b/03.microservices/step25.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -44,12 +44,12 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -305,7 +305,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -371,7 +371,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -379,7 +379,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -703,7 +703,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -711,7 +711,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -964,7 +964,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -972,7 +972,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -986,7 +986,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server @@ -1138,7 +1138,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1146,7 +1146,7 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step25.zip b/03.microservices/step25.zip index b95839ef..683a76c7 100644 Binary files a/03.microservices/step25.zip and b/03.microservices/step25.zip differ diff --git a/03.microservices/step29.md b/03.microservices/step29.md index dd81d07f..19319026 100644 --- a/03.microservices/step29.md +++ b/03.microservices/step29.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -44,17 +44,17 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -312,7 +312,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -379,7 +379,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -387,7 +387,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -401,7 +401,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client @@ -720,7 +720,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -728,7 +728,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -981,7 +981,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -989,7 +989,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1003,7 +1003,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server @@ -1155,7 +1155,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1163,7 +1163,7 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step29.zip b/03.microservices/step29.zip index 106054ad..54469d76 100644 Binary files a/03.microservices/step29.zip and b/03.microservices/step29.zip differ diff --git a/03.microservices/step34.md b/03.microservices/step34.md index 3ff4f2fa..bbe102f5 100644 --- a/03.microservices/step34.md +++ b/03.microservices/step34.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -40,17 +40,17 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -309,7 +309,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -378,7 +378,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -386,7 +386,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -396,7 +396,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.boot @@ -716,7 +716,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -724,7 +724,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -968,7 +968,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -976,7 +976,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -986,7 +986,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server org.springframework.boot @@ -1132,7 +1132,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1140,18 +1140,18 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul @@ -1343,7 +1343,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1351,7 +1351,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1501,7 +1501,7 @@ public class SpringCloudConfigServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1509,7 +1509,7 @@ public class SpringCloudConfigServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1524,17 +1524,17 @@ public class SpringCloudConfigServerApplicationTests { org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -1792,7 +1792,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -1859,7 +1859,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1867,7 +1867,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1881,7 +1881,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client @@ -2200,7 +2200,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -2208,7 +2208,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -2461,7 +2461,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -2469,7 +2469,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -2483,7 +2483,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server @@ -2635,7 +2635,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -2643,7 +2643,7 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step34.zip b/03.microservices/step34.zip index f32e0122..35de2735 100644 Binary files a/03.microservices/step34.zip and b/03.microservices/step34.zip differ diff --git a/03.microservices/step41.md b/03.microservices/step41.md index 8f172d6c..ea587bbe 100644 --- a/03.microservices/step41.md +++ b/03.microservices/step41.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -40,7 +40,7 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign @@ -60,12 +60,12 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -305,10 +305,11 @@ package com.in28minutes.microservices.currencyconversionservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableFeignClients("com.in28minutes.microservices.currencyconversionservice") @EnableDiscoveryClient @@ -319,8 +320,8 @@ public class CurrencyConversionServiceApplication { } @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); + public Sampler defaultSampler() { + return Sampler.ALWAYS_SAMPLE; } } @@ -332,7 +333,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -401,7 +402,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -409,7 +410,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -419,7 +420,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud @@ -570,9 +571,10 @@ package com.in28minutes.microservices.currencyexchangeservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableDiscoveryClient public class CurrencyExchangeServiceApplication { @@ -582,8 +584,8 @@ public class CurrencyExchangeServiceApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } @@ -760,7 +762,7 @@ limits-service.maximum=888 org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -768,7 +770,7 @@ limits-service.maximum=888 UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1012,7 +1014,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1020,7 +1022,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1030,7 +1032,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server org.springframework.boot @@ -1176,7 +1178,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1184,18 +1186,18 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul @@ -1294,9 +1296,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication @@ -1307,8 +1310,8 @@ public class NetflixZuulApiGatewayServerApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } ``` @@ -1410,7 +1413,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1418,7 +1421,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1568,7 +1571,7 @@ public class SpringCloudConfigServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1576,7 +1579,7 @@ public class SpringCloudConfigServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step41.zip b/03.microservices/step41.zip index 455a0d96..7c5ae032 100644 Binary files a/03.microservices/step41.zip and b/03.microservices/step41.zip differ diff --git a/03.microservices/step42.md b/03.microservices/step42.md index 6188e009..611ff36d 100644 --- a/03.microservices/step42.md +++ b/03.microservices/step42.md @@ -20,7 +20,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -28,7 +28,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -39,7 +39,7 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign @@ -59,12 +59,12 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -304,10 +304,11 @@ package com.in28minutes.microservices.currencyconversionservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableFeignClients("com.in28minutes.microservices.currencyconversionservice") @EnableDiscoveryClient @@ -318,8 +319,8 @@ public class CurrencyConversionServiceApplication { } @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); + public Sampler defaultSampler() { + return Sampler.ALWAYS_SAMPLE; } } @@ -331,7 +332,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -400,7 +401,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -408,7 +409,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -418,7 +419,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud @@ -569,9 +570,10 @@ package com.in28minutes.microservices.currencyexchangeservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableDiscoveryClient public class CurrencyExchangeServiceApplication { @@ -581,8 +583,8 @@ public class CurrencyExchangeServiceApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } @@ -737,7 +739,7 @@ limits-service.maximum=222 ```properties limits-service.minimum=8 limits-service.maximum=888 -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -760,7 +762,7 @@ management.security.enabled=false org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -768,7 +770,7 @@ management.security.enabled=false UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -973,7 +975,7 @@ public class LimitsServiceApplication { spring.application.name=limits-service spring.cloud.config.uri=http://localhost:8888 spring.profiles.active=qa -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -1018,7 +1020,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1026,7 +1028,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1036,7 +1038,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server org.springframework.boot @@ -1182,7 +1184,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1190,18 +1192,18 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul @@ -1300,9 +1302,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication @@ -1313,8 +1316,8 @@ public class NetflixZuulApiGatewayServerApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } ``` @@ -1416,7 +1419,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -1424,7 +1427,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -1579,7 +1582,7 @@ public class SpringCloudConfigServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1587,7 +1590,7 @@ public class SpringCloudConfigServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step42.zip b/03.microservices/step42.zip index 700b7dd0..f19f7127 100644 Binary files a/03.microservices/step42.zip and b/03.microservices/step42.zip differ diff --git a/03.microservices/step43.md b/03.microservices/step43.md index d4da0c9c..e71813fa 100644 --- a/03.microservices/step43.md +++ b/03.microservices/step43.md @@ -21,7 +21,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -29,7 +29,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -40,7 +40,7 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign @@ -60,12 +60,12 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -305,10 +305,11 @@ package com.in28minutes.microservices.currencyconversionservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableFeignClients("com.in28minutes.microservices.currencyconversionservice") @EnableDiscoveryClient @@ -319,8 +320,8 @@ public class CurrencyConversionServiceApplication { } @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); + public Sampler defaultSampler() { + return Sampler.ALWAYS_SAMPLE; } } @@ -332,7 +333,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -401,7 +402,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -409,7 +410,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -419,7 +420,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud @@ -570,9 +571,10 @@ package com.in28minutes.microservices.currencyexchangeservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableDiscoveryClient public class CurrencyExchangeServiceApplication { @@ -582,8 +584,8 @@ public class CurrencyExchangeServiceApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } @@ -738,7 +740,7 @@ limits-service.maximum=222 ```properties limits-service.minimum=8 limits-service.maximum=888 -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -761,7 +763,7 @@ management.security.enabled=false org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -769,7 +771,7 @@ management.security.enabled=false UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -974,7 +976,7 @@ public class LimitsServiceApplication { spring.application.name=limits-service spring.cloud.config.uri=http://localhost:8888 spring.profiles.active=qa -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -1019,7 +1021,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1027,7 +1029,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1037,7 +1039,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server org.springframework.boot @@ -1183,7 +1185,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1191,18 +1193,18 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul @@ -1301,9 +1303,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication @@ -1314,8 +1317,8 @@ public class NetflixZuulApiGatewayServerApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } ``` @@ -1417,7 +1420,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -1425,7 +1428,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -1580,7 +1583,7 @@ public class SpringCloudConfigServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1588,7 +1591,7 @@ public class SpringCloudConfigServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step43.zip b/03.microservices/step43.zip index a1686fcc..c204b0bd 100644 Binary files a/03.microservices/step43.zip and b/03.microservices/step43.zip differ diff --git a/03.microservices/step44.md b/03.microservices/step44.md index 85886072..7c26ae20 100644 --- a/03.microservices/step44.md +++ b/03.microservices/step44.md @@ -20,7 +20,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -28,7 +28,7 @@ UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -39,7 +39,7 @@ org.springframework.cloud - spring-cloud-starter-feign + spring-cloud-starter-openfeign @@ -59,12 +59,12 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-ribbon + spring-cloud-starter-netflix-ribbon @@ -304,10 +304,11 @@ package com.in28minutes.microservices.currencyconversionservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableFeignClients("com.in28minutes.microservices.currencyconversionservice") @EnableDiscoveryClient @@ -318,8 +319,8 @@ public class CurrencyConversionServiceApplication { } @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); + public Sampler defaultSampler() { + return Sampler.ALWAYS_SAMPLE; } } @@ -331,7 +332,7 @@ public class CurrencyConversionServiceApplication { ```java package com.in28minutes.microservices.currencyconversionservice; -import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -400,7 +401,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -408,7 +409,7 @@ public class CurrencyConversionServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -418,7 +419,7 @@ public class CurrencyConversionServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud @@ -569,9 +570,10 @@ package com.in28minutes.microservices.currencyexchangeservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @SpringBootApplication @EnableDiscoveryClient public class CurrencyExchangeServiceApplication { @@ -581,8 +583,8 @@ public class CurrencyExchangeServiceApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } @@ -737,7 +739,7 @@ limits-service.maximum=222 ```properties limits-service.minimum=8 limits-service.maximum=888 -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -760,7 +762,7 @@ management.security.enabled=false org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -768,7 +770,7 @@ management.security.enabled=false UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -780,7 +782,7 @@ management.security.enabled=false org.springframework.cloud - spring-cloud-starter-hystrix + spring-cloud-starter-netflix-hystrix @@ -994,7 +996,7 @@ public class LimitsServiceApplication { spring.application.name=limits-service spring.cloud.config.uri=http://localhost:8888 spring.profiles.active=qa -management.security.enabled=false +management.endpoints.web.exposure.include=* ``` --- @@ -1039,7 +1041,7 @@ public class LimitsServiceApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1047,7 +1049,7 @@ public class LimitsServiceApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 @@ -1057,7 +1059,7 @@ public class LimitsServiceApplicationTests { org.springframework.cloud - spring-cloud-starter-eureka-server + spring-cloud-starter-netflix-eureka-server org.springframework.boot @@ -1203,7 +1205,7 @@ public class NetflixEurekaNamingServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1211,18 +1213,18 @@ public class NetflixEurekaNamingServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-netflix-eureka-client org.springframework.cloud - spring-cloud-starter-zuul + spring-cloud-starter-netflix-zuul @@ -1321,9 +1323,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; import org.springframework.context.annotation.Bean; +import brave.sampler.Sampler; + @EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication @@ -1334,8 +1337,8 @@ public class NetflixZuulApiGatewayServerApplication { } @Bean - public AlwaysSampler defaultSampler(){ - return new AlwaysSampler(); + public Sampler defaultSampler(){ + return Sampler.ALWAYS_SAMPLE; } } ``` @@ -1437,7 +1440,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + 2.0.0.RELEASE @@ -1445,7 +1448,7 @@ public class NetflixZuulApiGatewayServerApplicationTests { UTF-8 UTF-8 1.8 - Dalston.RC1 + Finchley.M8 @@ -1600,7 +1603,7 @@ public class SpringCloudConfigServerApplicationTests { org.springframework.boot spring-boot-starter-parent - 2.0.0.M3 + 2.0.0.RELEASE @@ -1608,7 +1611,7 @@ public class SpringCloudConfigServerApplicationTests { UTF-8 UTF-8 1.8 - Finchley.M2 + Finchley.M8 diff --git a/03.microservices/step44.zip b/03.microservices/step44.zip index 64a5e15f..0cdde9d0 100644 Binary files a/03.microservices/step44.zip and b/03.microservices/step44.zip differ diff --git a/03.microservices/zipkin-distributed-tracing-server/.DS_Store b/03.microservices/zipkin-distributed-tracing-server/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/03.microservices/zipkin-distributed-tracing-server/.DS_Store and /dev/null differ diff --git a/03.microservices/zipkin-distributed-tracing-server/pom.xml b/03.microservices/zipkin-distributed-tracing-server/pom.xml deleted file mode 100644 index 4d487e30..00000000 --- a/03.microservices/zipkin-distributed-tracing-server/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - 4.0.0 - - com.in28minutes.microservices - zipkin-distributed-tracing-server - 0.0.1-SNAPSHOT - jar - - zipkin-distributed-tracing-server - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M3 - - - - - UTF-8 - UTF-8 - 1.8 - Finchley.M2 - - - - - - org.springframework.cloud - spring-cloud-sleuth-zipkin-stream - - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - - - io.zipkin.java - zipkin-autoconfigure-ui - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - diff --git a/03.microservices/zipkin-distributed-tracing-server/src/main/java/com/in28minutes/microservices/zipkindistributedtracingserver/ZipkinDistributedTracingServerApplication.java b/03.microservices/zipkin-distributed-tracing-server/src/main/java/com/in28minutes/microservices/zipkindistributedtracingserver/ZipkinDistributedTracingServerApplication.java deleted file mode 100644 index a6c20698..00000000 --- a/03.microservices/zipkin-distributed-tracing-server/src/main/java/com/in28minutes/microservices/zipkindistributedtracingserver/ZipkinDistributedTracingServerApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.in28minutes.microservices.zipkindistributedtracingserver; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import zipkin.server.EnableZipkinServer; - -@EnableZipkinServer -@SpringBootApplication -public class ZipkinDistributedTracingServerApplication { - - public static void main(String[] args) { - SpringApplication.run(ZipkinDistributedTracingServerApplication.class, args); - } -} \ No newline at end of file diff --git a/03.microservices/zipkin-distributed-tracing-server/src/main/resources/application.properties b/03.microservices/zipkin-distributed-tracing-server/src/main/resources/application.properties deleted file mode 100644 index 2c2f4502..00000000 --- a/03.microservices/zipkin-distributed-tracing-server/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -spring.application.name=zipkin-distributed-tracing-server -server.port=9411 \ No newline at end of file diff --git a/03.microservices/zipkin-distributed-tracing-server/src/test/java/com/in28minutes/microservices/zipkindistributedtracingserver/ZipkinDistributedTracingServerApplicationTests.java b/03.microservices/zipkin-distributed-tracing-server/src/test/java/com/in28minutes/microservices/zipkindistributedtracingserver/ZipkinDistributedTracingServerApplicationTests.java deleted file mode 100644 index e1f4ac42..00000000 --- a/03.microservices/zipkin-distributed-tracing-server/src/test/java/com/in28minutes/microservices/zipkindistributedtracingserver/ZipkinDistributedTracingServerApplicationTests.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.in28minutes.microservices.zipkindistributedtracingserver; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class ZipkinDistributedTracingServerApplicationTests { - - @Test - public void contextLoads() { - } - -} diff --git a/notes.md b/notes.md index 1a6a1f2e..1c4848a8 100644 --- a/notes.md +++ b/notes.md @@ -143,8 +143,8 @@ Step 9 : Introduction to Spring Data JPA Step 10 : More JPA Repository : findById and findAll ## Versions -- 1.5.2.RELEASE -- Dalston.RC1 +- 2.0.0.RELEASE +- Finchley.M8 ## URLs @@ -354,1651 +354,4 @@ PROD -> PROD1 } -``` - -## Complete Code Example - -### /config-example-service/pom.xml - -```xml - - - 4.0.0 - - com.in28minutes.microservices - config-example-service - 0.0.1-SNAPSHOT - jar - - config-example-service - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 1.5.6.RELEASE - - - - - UTF-8 - UTF-8 - 1.8 - Dalston.SR3 - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.cloud - spring-cloud-starter-config - - - org.springframework.cloud - spring-cloud-starter-bus-amqp - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - -``` ---- - -### /config-example-service/src/main/java/com/in28minutes/microservices/configexampleservice/ConfigExampleServiceApplication.java - -```java -package com.in28minutes.microservices.configexampleservice; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class ConfigExampleServiceApplication { - - public static void main(String[] args) { - SpringApplication.run(ConfigExampleServiceApplication.class, args); - } -} -``` ---- - -### /config-example-service/src/main/java/com/in28minutes/microservices/configexampleservice/ConfigurationController.java - -```java -package com.in28minutes.microservices.configexampleservice; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ConfigurationController { - - @Autowired - private Configuration configuration; - - @GetMapping("/limits") - public Limit retrieveLimits() { - Limit limit = new Limit(); - limit.setMinimum(configuration.getMinimum()); - limit.setMaximum(configuration.getMaximum()); - return limit; - } - -} - -class Limit { - private int maximum; - private int minimum; - - public int getMaximum() { - return maximum; - } - - public int getMinimum() { - return minimum; - } - - public void setMaximum(int maximum) { - this.maximum = maximum; - } - - public void setMinimum(int minimum) { - this.minimum = minimum; - } - -} - -@Component -@ConfigurationProperties("config") -class Configuration { - private int minimum; - private int maximum; - - public int getMinimum() { - return minimum; - } - - public void setMinimum(int minimum) { - this.minimum = minimum; - } - - public int getMaximum() { - return maximum; - } - - public void setMaximum(int maximum) { - this.maximum = maximum; - } - -} -``` ---- - -### /config-example-service/src/main/resources/bootstrap.properties - -```properties -#config.maximum=100 -#config.minimum=10 - -spring.application.name=limits-service -spring.cloud.config.uri=http://localhost:8888 -spring.profiles.active=qa -management.security.enabled=false -``` ---- - -### /config-example-service/src/test/java/com/in28minutes/microservices/configexampleservice/ConfigExampleServiceApplicationTests.java - -```java -package com.in28minutes.microservices.configexampleservice; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class ConfigExampleServiceApplicationTests { - - @Test - public void contextLoads() { - } - -} -``` ---- - -### /currency-conversion-service/pom.xml - -```xml - - - 4.0.0 - - com.in28minutes.microservices - currency-conversion-service - 0.0.1-SNAPSHOT - jar - - currency-conversion-service - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M3 - - - - - UTF-8 - UTF-8 - 1.8 - Finchley.M2 - - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework.cloud - spring-cloud-starter-sleuth - - - - org.springframework.cloud - spring-cloud-sleuth-zipkin - - - - org.springframework.cloud - spring-cloud-starter-bus-amqp - - - - org.springframework.cloud - spring-cloud-starter-feign - - - - org.springframework.cloud - spring-cloud-starter-ribbon - - - - org.springframework.cloud - spring-cloud-starter-eureka - - - - org.springframework.cloud - spring-cloud-starter-hystrix - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - -``` ---- - -### /currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionBean.java - -```java -package com.in28minutes.microservices.currencyconversionservice; - -import java.math.BigDecimal; - -public class CurrencyConversionBean { - private String fromCurrency; - private String toCurrency; - private BigDecimal inputAmount; - private BigDecimal outputAmount; - private Long id; - - public CurrencyConversionBean() { - - } - - public CurrencyConversionBean(Long id,String from, String to, BigDecimal inputValue, BigDecimal outputValue) { - super(); - this.id = id; - this.fromCurrency = from; - this.toCurrency = to; - this.inputAmount = inputValue; - this.outputAmount = outputValue; - } - - public String getFromCurrency() { - return fromCurrency; - } - - public String getToCurrency() { - return toCurrency; - } - - public BigDecimal getInputAmount() { - return inputAmount; - } - - public BigDecimal getOutputAmount() { - return outputAmount; - } - - public Long getId() { - return id; - } -} -``` ---- - -### /currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionController.java - -```java -package com.in28minutes.microservices.currencyconversionservice; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.client.RestTemplate; - -import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; - -@RestController -public class CurrencyConversionController { - - @Autowired - CurrencyExchangeServiceProxy proxy; - - @HystrixCommand(fallbackMethod="getDefaultConversionResponse") - @GetMapping("/currency-converter-direct/from/{from}/to/{to}/amount/{amount}") - public CurrencyConversionBean conversion(@PathVariable String from, @PathVariable String to, - @PathVariable BigDecimal amount) { - - Map uriVariables = new HashMap<>(); - uriVariables.put("from", from); - uriVariables.put("to", to); - - ResponseEntity responseEntity = new RestTemplate().getForEntity( - "http://localhost:8000/currency-exchange/from/{from}/to/{to}", - CurrencyConversionBean.class, uriVariables); - - return new CurrencyConversionBean(responseEntity.getBody().getId(),from, to, amount, responseEntity.getBody().getInputAmount().multiply(amount)); - } - - public CurrencyConversionBean getDefaultConversionResponse(String from, String to, - BigDecimal amount){ - return new CurrencyConversionBean(0L,from, to, BigDecimal.ONE, BigDecimal.ONE.multiply(amount)); - } - - @GetMapping("/currency-converter-feign/from/{from}/to/{to}/amount/{amount}") - public CurrencyConversionBean conversionFeign(@PathVariable("from") String from, @PathVariable("to") String to, - @PathVariable("amount") BigDecimal amount) { - CurrencyConversionBean result = proxy.findByCurrencyFromAndCurrencyTo(from, to); - - return new CurrencyConversionBean(result.getId(),from, to, amount, result.getInputAmount().multiply(amount)); - } - -} -``` ---- - -### /currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionServiceApplication.java - -```java -package com.in28minutes.microservices.currencyconversionservice; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.cloud.netflix.hystrix.EnableHystrix; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; -import org.springframework.context.annotation.Bean; - -@SpringBootApplication -@EnableDiscoveryClient -@EnableHystrix -@EnableFeignClients("com.in28minutes.microservices.currencyconversionservice") -public class CurrencyConversionServiceApplication { - - public static void main(String[] args) { - SpringApplication.run(CurrencyConversionServiceApplication.class, args); - } - - @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); - } - -} -``` ---- - -### /currency-conversion-service/src/main/java/com/in28minutes/microservices/currencyconversionservice/CurrencyExchangeServiceProxy.java - -```java -package com.in28minutes.microservices.currencyconversionservice; - -import org.springframework.cloud.netflix.feign.FeignClient; -import org.springframework.cloud.netflix.ribbon.RibbonClient; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -//@FeignClient(name = "currency-exchange-service", url = "localhost:8000") -//@FeignClient(name = "currency-exchange-service") -@FeignClient(name = "zuul-api-gateway-server") -@RibbonClient(name = "currency-exchange-service") -public interface CurrencyExchangeServiceProxy { - //@RequestMapping(method=RequestMethod.GET, value = "/currency-exchange/from/{from}/to/{to}") - @RequestMapping(method=RequestMethod.GET, value = "/currency-exchange-service/currency-exchange/from/{from}/to/{to}") - CurrencyConversionBean findByCurrencyFromAndCurrencyTo(@PathVariable("from") String from, - @PathVariable("to") String to); -} -``` ---- - -### /currency-conversion-service/src/main/resources/application.properties - -```properties -server.port=8100 -spring.application.name=currency-conversion-service - -#currency-exchange-service.ribbon.listOfServers=http://localhost:8000,http://localhost:8001 -eureka.client.service-url.default-zone=http://localhost:8761/eureka -``` ---- - -### /currency-conversion-service/src/test/java/com/in28minutes/microservices/currencyconversionservice/CurrencyConversionServiceApplicationTests.java - -```java -package com.in28minutes.microservices.currencyconversionservice; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class CurrencyConversionServiceApplicationTests { - - @Test - public void contextLoads() { - } - -} -``` ---- - -### /currency-exchange/pom.xml - -```xml - - - 4.0.0 - - com.in28minutes.microservices - currency-exchange-service - 0.0.1-SNAPSHOT - jar - - currency-exchange-service - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M3 - - - - - UTF-8 - UTF-8 - 1.8 - Finchley.M2 - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.cloud - spring-cloud-starter-eureka - - - org.springframework.cloud - spring-cloud-starter-sleuth - - - org.springframework.cloud - spring-cloud-sleuth-zipkin - - - - org.springframework.cloud - spring-cloud-starter-bus-amqp - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - com.h2database - h2 - runtime - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-data-rest - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - -``` ---- - -### /currency-exchange/src/main/java/com/in28minutes/microservices/currencyexchange/CurrencyExchangeApplication.java - -```java -package com.in28minutes.microservices.currencyexchange; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; -import org.springframework.context.annotation.Bean; - -@SpringBootApplication -@EnableDiscoveryClient -public class CurrencyExchangeApplication { - - public static void main(String[] args) { - SpringApplication.run(CurrencyExchangeApplication.class, args); - } - - @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); - } - -} -``` ---- - -### /currency-exchange/src/main/java/com/in28minutes/microservices/currencyexchange/entity/Currency.java - -```java -package com.in28minutes.microservices.currencyexchange.entity; - -public enum Currency { - INR,USD,EUR -} -``` ---- - -### /currency-exchange/src/main/java/com/in28minutes/microservices/currencyexchange/entity/ExchangeValue.java - -```java -package com.in28minutes.microservices.currencyexchange.entity; - -import java.math.BigDecimal; - -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.Id; - -@Entity -public class ExchangeValue { - - @Id - private Long id; - - @Enumerated(EnumType.STRING) - private Currency currencyFrom; - - @Enumerated(EnumType.STRING) - private Currency currencyTo; - - private BigDecimal inputAmount; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Currency getCurrencyFrom() { - return currencyFrom; - } - - public void setCurrencyFrom(Currency currencyFrom) { - this.currencyFrom = currencyFrom; - } - - public Currency getCurrencyTo() { - return currencyTo; - } - - public void setCurrencyTo(Currency currencyTo) { - this.currencyTo = currencyTo; - } - - public BigDecimal getInputAmount() { - return inputAmount; - } - - public void setInputAmount(BigDecimal inputAmount) { - this.inputAmount = inputAmount; - } -} -``` ---- - -### /currency-exchange/src/main/java/com/in28minutes/microservices/currencyexchange/entity/ExchangeValueController.java - -```java -package com.in28minutes.microservices.currencyexchange.entity; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ExchangeValueController { - - @Autowired - ExchangeValueRepository repository; - - @Autowired - Environment environment; - - @GetMapping("/currency-exchange/from/{from}/to/{to}") - public ExchangeValue exchangeService(@PathVariable String from, @PathVariable String to) { - ExchangeValue exchangeValue = repository.findByCurrencyFromAndCurrencyTo(Currency.valueOf(from), Currency.valueOf(to)); - exchangeValue.setId(Long.parseLong(environment.getProperty("local.server.port"))); - return exchangeValue; - } - -} -``` ---- - -### /currency-exchange/src/main/java/com/in28minutes/microservices/currencyexchange/entity/ExchangeValueRepository.java - -```java -package com.in28minutes.microservices.currencyexchange.entity; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface ExchangeValueRepository extends JpaRepository { - ExchangeValue findByCurrencyFromAndCurrencyTo(Currency from, Currency to); -} -``` ---- - -### /currency-exchange/src/main/resources/application.properties - -```properties -server.port=8000 -spring.application.name=currency-exchange-service - -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true - -eureka.client.service-url.default-zone=http://localhost:8761/eureka -``` ---- - -### /currency-exchange/src/main/resources/data.sql - -``` -insert into exchange_value -values(10001, 'USD', 'INR', 65); -insert into exchange_value -values(10002, 'EUR', 'INR', 75); -``` ---- - -### /currency-exchange/src/test/java/com/in28minutes/microservices/currencyexchange/CurrencyExchangeApplicationTests.java - -```java -package com.in28minutes.microservices.currencyexchange; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class CurrencyExchangeApplicationTests { - - @Test - public void contextLoads() { - } - -} -``` ---- - -### /eureka-server/pom.xml - -```xml - - - 4.0.0 - - com.in28minutes.microservices - eureka-server - 0.0.1-SNAPSHOT - jar - - eureka-server - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M3 - - - - - UTF-8 - UTF-8 - 1.8 - Finchley.M2 - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.cloud - spring-cloud-starter-config - - - org.springframework.cloud - spring-cloud-starter-eureka-server - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - -``` ---- - -### /eureka-server/src/main/java/com/in28minutes/microservices/eurekaserver/EurekaServerApplication.java - -```java -package com.in28minutes.microservices.eurekaserver; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; - -@SpringBootApplication -@EnableEurekaServer -public class EurekaServerApplication { - - public static void main(String[] args) { - SpringApplication.run(EurekaServerApplication.class, args); - } -} -``` ---- - -### /eureka-server/src/main/resources/application.properties - -```properties -server.port=8761 -spring.application.name=eureka-server - -eureka.client.register-with-eureka=false -eureka.client.fetch-registry=false -``` ---- - -### /eureka-server/src/test/java/com/in28minutes/microservices/eurekaserver/EurekaServerApplicationTests.java - -```java -package com.in28minutes.microservices.eurekaserver; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class EurekaServerApplicationTests { - - @Test - public void contextLoads() { - } - -} -``` ---- - -### /git-configuration-repo/limits-service-qa.properties - -```properties -config.maximum=78 -config.minimum=66 -``` ---- - -### /git-configuration-repo/limits-service.properties - -```properties -config.maximum=99 -config.minimum=9 -``` ---- - -### /spring-cloud-config-server/pom.xml - -```xml - - - 4.0.0 - - com.in28minutes.microservices - spring-cloud-config-server - 0.0.1-SNAPSHOT - jar - - spring-cloud-config-server - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M3 - - - - - UTF-8 - UTF-8 - 1.8 - Finchley.M2 - - - - - org.springframework.cloud - spring-cloud-config-server - - - - org.springframework.cloud - spring-cloud-starter-bus-amqp - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - -``` ---- - -### /spring-cloud-config-server/src/main/java/com/in28minutes/microservices/springcloudconfigserver/SpringCloudConfigServerApplication.java - -```java -package com.in28minutes.microservices.springcloudconfigserver; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.config.server.EnableConfigServer; - -@SpringBootApplication -@EnableConfigServer -public class SpringCloudConfigServerApplication { - - public static void main(String[] args) { - SpringApplication.run(SpringCloudConfigServerApplication.class, args); - } -} -``` ---- - -### /spring-cloud-config-server/src/main/resources/application.properties - -```properties -server.port=8888 -spring.application.name=spring-cloud-config-server - -spring.cloud.config.server.git.uri=file:///in28Minutes/git/getting-started-in-5-steps/zzz-microservices/git-configuration-repo -``` ---- - -### /spring-cloud-config-server/src/test/java/com/in28minutes/microservices/springcloudconfigserver/SpringCloudConfigServerApplicationTests.java - -```java -package com.in28minutes.microservices.springcloudconfigserver; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class SpringCloudConfigServerApplicationTests { - - @Test - public void contextLoads() { - } - -} -``` ---- - -### /zipkin-server/pom.xml - -```xml - - - 4.0.0 - - com.in28minutes.microservices - zipkin-server - 0.0.1-SNAPSHOT - jar - - zipkin-server - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M3 - - - - - UTF-8 - UTF-8 - 1.8 - Finchley.M2 - - - - - org.springframework.cloud - spring-cloud-sleuth-zipkin-stream - - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - - - io.zipkin.java - zipkin-autoconfigure-ui - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - -``` ---- - -### /zipkin-server/src/main/java/com/in28minutes/microservices/zipkinserver/ZipkinServerApplication.java - -```java -package com.in28minutes.microservices.zipkinserver; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import zipkin.server.EnableZipkinServer; - -@SpringBootApplication -@EnableZipkinServer -public class ZipkinServerApplication { - - public static void main(String[] args) { - SpringApplication.run(ZipkinServerApplication.class, args); - } -} -``` ---- - -### /zipkin-server/src/main/resources/application.properties - -```properties -server.port=9411 -spring.application.name=zipkin-server -``` ---- - -### /zipkin-server/src/test/java/com/in28minutes/microservices/zipkinserver/ZipkinServerApplicationTests.java - -```java -package com.in28minutes.microservices.zipkinserver; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class ZipkinServerApplicationTests { - - @Test - public void contextLoads() { - } - -} -``` ---- - -### /zuul-api-gateway-server/pom.xml - -```xml - - - 4.0.0 - - com.in28minutes.microservices - zuul-api-gateway-server - 0.0.1-SNAPSHOT - jar - - zuul-api-gateway-server - Demo project for Spring Boot - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M3 - - - - - UTF-8 - UTF-8 - 1.8 - Finchley.M2 - - - - - org.springframework.cloud - spring-cloud-starter-eureka - - - org.springframework.cloud - spring-cloud-starter-sleuth - - - org.springframework.cloud - spring-cloud-starter-zuul - - - org.springframework.cloud - spring-cloud-sleuth-zipkin - - - - org.springframework.cloud - spring-cloud-starter-bus-amqp - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - -``` ---- - -### /zuul-api-gateway-server/src/main/java/com/in28minutes/microservices/zuulapigatewayserver/SimpleLoggingFilter.java - -```java -package com.in28minutes.microservices.zuulapigatewayserver; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import com.netflix.zuul.ZuulFilter; -import com.netflix.zuul.context.RequestContext; - -@Component -public class SimpleLoggingFilter extends ZuulFilter { - - Logger log = LoggerFactory.getLogger(this.getClass()); - - @Override - public Object run() { - RequestContext context = RequestContext.getCurrentContext(); - - log.info("{} {} {}", - context, - context.getRequest().getRequestURL(), - context.getZuulRequestHeaders()); - return null; - } - - @Override - public boolean shouldFilter() { - return true; - } - - @Override - public int filterOrder() { - return 1; - } - - @Override - public String filterType() { - return "pre"; - } - -} -``` ---- - -### /zuul-api-gateway-server/src/main/java/com/in28minutes/microservices/zuulapigatewayserver/ZuulApiGatewayServerApplication.java - -```java -package com.in28minutes.microservices.zuulapigatewayserver; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -import org.springframework.cloud.sleuth.sampler.AlwaysSampler; -import org.springframework.context.annotation.Bean; - -@EnableZuulProxy -@EnableDiscoveryClient -@SpringBootApplication -public class ZuulApiGatewayServerApplication { - - public static void main(String[] args) { - SpringApplication.run(ZuulApiGatewayServerApplication.class, args); - } - - @Bean - public AlwaysSampler defaultSampler() { - return new AlwaysSampler(); - } -} -``` ---- - -### /zuul-api-gateway-server/src/main/resources/application.properties - -```properties -server.port=8765 -spring.application.name=zuul-api-gateway-server - -eureka.client.service-url.default-zone=http://localhost:8761/eureka -``` ---- - -### /zuul-api-gateway-server/src/test/java/com/in28minutes/microservices/zuulapigatewayserver/ZuulApiGatewayServerApplicationTests.java - -```java -package com.in28minutes.microservices.zuulapigatewayserver; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class ZuulApiGatewayServerApplicationTests { - - @Test - public void contextLoads() { - } - -} -``` ---- +``` \ No newline at end of file