Skip to content

Exposed MS APIs(springboot) calling an external MS by using configuration from local + RESTTemplate library

Notifications You must be signed in to change notification settings

ram2github/SimpleRestTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleRestTemplate

An exposed Quote Micro Service calls an external SpringBoot QuotesMS for building the final response This example exposes a REST API to get Quote when you type http:https://localhost:9000/quote/ in the browser URL,

  • an external Microservice is invoked to fetch a random quote on Spring boot
  • some meta data ( like sender ID and timestamp) are added to the final Response (Quote Object) This example illustrates
  • usage of SpringBoot application
  • usage of AutoWiring of singletons ( RestTemplates and RestTeamplate Builders)
  • usage Jackson libraries to 'bind' JSON response to custom 'Quote' and 'Value' objects
  • how @JsonIgnoreProperties(ignoreUnknown = true) is used to NOT error out during the binding step when extra attributes are present in the custom Object Type
  • loading custom properties from yaml file
  • illustrating validation of properties at startup

Note : config currently NOT kept in Config Server port and QuoteService URL/senderID config is present in application.yml file

About

Exposed MS APIs(springboot) calling an external MS by using configuration from local + RESTTemplate library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published