Oops! Sorry!!

This site doesn't support Internet Explorer. Please use a modern browser like Chrome, Firefox or Edge.

Java 8

Functional Interface

Functional Interface

Functional Interface is interface which contain single abstract method - (SAM)

Functional Interface is used to invoke or call lambda expression

Functional Interface is type of Lambda expression

You can take any no of defualt or static method in functional interface, restriction only applicable for abstract method

Ex : Below are the examples

  • Runnable (Interface) - contains only - run() method

  • Callable (Interface) - contains only - call() method

  • Comparable - contains only - compareTo() mehtod

  • Program1 : Invoking Lambda expression by using Functional Interface 

  • Program 2 - WAP add two number wihtout lambda expression and with lambda expression

    Program 3 - Multithreading Example wihtout & WithLambda Expression

    Summary - functional Interface

    We will discuss about Microservice different challenges while building microservices

    We will start problem no 1 : Bound context, 2. Configuration Management, 3. Dynamic Scale UP and Dynamic scale Down, 4. Visibility, 5. Pack of Cards

    1. Bound context :

    Ullam qui culpa officiis quo accusamus et numquam. Non dolor exercitationem expedita et rerum. In corporis delectus et magnam rerum. Et maxime natus sed aut temporibus dolor qui.

    what do I mean earlier we have seen in Instead of building one big monolithic applicaiton, we have built 5 small microserices 10 or 20 or 1000 , how do you Identify the boundry of each microservices 

    How do you Identify what to do each of microservices

    How would you decide what you should do each of microservices you should not do

    For New Application its much more difficult , probably you don't have business knowledge to stablish right boundry between these microsercices

    Deciding boundary of microservices is evaluation process , Its something get you right at first time which you need to play around it.

    Try and fallow domain driven design, try to find right boundary for microservices based on knowledge with that in point of time.

    As Important thing to keep, as keep gaining knowledge you should keep back knowledge to microservices into deciding what is right boundaries for these microservice

    Challenge is configuration management lets look in details.

    We said earlier we would have 5 microservices 

    We said we would have 5 or 50 microservices , these microservices would have multiple instances in each environment and there are multiple environement, like dev, test, stage and prod,

    These Microservices would have multiple instances see below

    Lets say there 10 microservices in 5 environement 

    Each Microservices has 50 instances , so we are taking about tons of configuraiton so that lots of work for operation Team to mentain.

    third important challenge is dynamic scale up and dynamic scale down.

    Stablishing the technology to do that, (ex kubernetes ) Load of Microservices will different on on different instances on different time 

    At Perticular time might be I need two instances of particular microservices of two, but letter at different point of time might I needing 10 instances of this microservicesso I should be able to bring new instances of microservices UP and bring down older instances of mcirservices when they are realy not needed all with dynamic load balancing beacause when there is one instance of microservices1, and 4 instance of mciroserce2 , I want to dist

    I want to distribuite all instance of of microservices1 , If there are 4 instance of microservices2 comming up , I would want to insure that all new one being used full extend , so we need ability to dynamicly bring new instances and also distribute the load among the new instances 

    4th and most important challenge is visibility lets look in details.

    If I say functionality is now distributed among 5 microservices and there is bug

    How do you identify where the bug is , you have to centeralise log where you can go and find out what happen on perticular microservices on specific request shich microservices cause the problem

    Not Just that we also need monitoring around these microservices because we have 100 of microservices we need to be able to identify which are microservices are down , you would want to autometically identify the the server, which they not have enough disk space all kind of this thing need to be automated.

    We need great visibility into what happening to the microservices 

    Last but not the least Pack of cards see next section