Posts

Showing posts from 2022

Micro Service

Image
Amazon  C ircuit Breaker :  When the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately. After the timeout expires the circuit breaker allows a limited number of test requests to pass through. If those requests succeed the circuit breaker resumes normal operation. Otherwise, if there is a failure the timeout period begins again. @EnableCircuitBreaker class UserRegistrationConfiguration { Amazon <a target="_blank" href="https://www.amazon.in/b?_encoding=UTF8&tag=bayareddy-21&linkCode=ur2&linkId=15ff6c4a39b041249058632ec17c92c8&camp=3638&creative=24630&node=1389375031">TV</a>

Java 8

 package com.java8.functional; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; public class Test { // Functional interfaces // -Predicate // -BinaryOpeator // -Function public static void main(String[] args) { // -Predicate Predicate<String> strPrd=(s)->s.equals("baya"); Predicate<String> strPrd1=(s)->s.equals("baya1"); System.out.println(strPrd.or(strPrd1).test("baya1")); List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);   Predicate<Integer> even=(i)->i%2==0;    System.out.println(list.stream().filter(even).collect(Collectors.toList())); System.out.println(list.stream().filter(even.negate()).collect(Collectors.toList()));   // -BinaryOpeator B

temp

Image