Posts

Showing posts from June, 2021

Microservice -Cloud Configurations -Spring

Image
 Let's explore the Microservice deployments ,registration using Service Registry and controlling the communication using APIGateways in next blog. Will create a microservice Library using H2 databass fro the persistance. The entire codebase will be shared in the git will share at the end of the blog. Let's create the Books microservices like below Controller  Services Repository  Entity   application.yaml server : port : 9000 Postman test output Create the Books microservices the same way. Refer to the code from the end. Mail goal is to access using the gateway service Big Step Going to add the microservices to the Service Registry to do that create one more microservices with the below dependency < dependencies > < dependency > < groupId >org.springframework.cloud</ groupId > < artifactId >spring-cloud-starter-netflix-eureka-server</ artifactId > </ dependency > < dependency > < groupId >org.spr

JAVA 8 Predefined Functions

Image
 Java 8 has considerable up-gradation when compare to other releases, I am going to discuss some key concepts that are very much required for the understanding of functional programming way of implementation. I have written one Demo problem which covers all the concepts, better refer to  this code  while reading. Better to understand what is lamdas, default methods, and static methods, this article will be a quick reference. 👍 4 Key Predefined Functions Interfaces 1.) Predicate 2.)Function 3.)Consumer 4.)Supplier 1.)Predicate I nterface Predicate<T> { boolean test(T  t);// functional interface  default Predicate<T> add(); default Predicate<T> or();  default Predicate<T> negate()  static <T> Predicate<T> isEqual(Object targetRef) ====>single static method } This predicate is mainly used for the conditions check, which contains a single abstract method, 3 default methods, and single static methods. Single Abstract Method test(T k); This method will