Deep Dive to Hystrix Resiliency Maintenance

In my previous Microservice Tutorial , I have shown How We can use Hystrix as a circuit Breaker and how to give our service a breathing room to recover itself. In this tutorial, we will take a deep dive into Hystrix architecture and we will eventually get to know How it manages resiliency in a complex system. Let assume there ...

Read More »

Loading files with backpressure – RxJava FAQ

Processing file as a stream turns out to be tremendously effective and convenient. Many people seem to forget that since Java 8 (3+ years!) we can very easily turn any file into a stream of lines: String filePath = "foobar.txt"; try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) { reader.lines() .filter(line -> !line.startsWith("#")) .map(String::toLowerCase) .flatMap(line -> Stream.of(line.split(" "))) .forEach(System.out::println); } reader.lines() returns ...

Read More »

What is JavaServer Faces (JSF)

java-interview-questions-answers

This is a two-part series in which I look at JSF 2 and how it fits into the Java EE ecosystem. In part 1 I introduce the basic idea behind JavaServer Pages (JSF) and in part 2 I will introduce the Facelets declaration language. When building a web application we provide the end user with a way to interact with ...

Read More »

Make Your Groovy Objects More Bullet-Proof

Groovy has the Immutable annotation which allows to create immutable classes, which is a prerequisite for creating value objects. Unfortunately, when a class has been annotated with Immutable it’s no longer possible to add your own constructor to verify if provided parameters are not null, which would make our value objects really bullet-proof. @groovy.transform.Immutable class Money { BigDecimal amount } ...

Read More »

Documentation is another deliverable and 7 other rules

We (the programmers) had documentation coming out our ears. Architecture documents, design documents, user guides, functional specifications, program specifications, and much much more. Most of the documentation was worse than useless because it gave the illusion that everything was recorded and anyone could learn (almost) anything any time. Some of the documentation was just out of date. The worst was ...

Read More »

noException in stream operation

This article is about some simple coding practice. Nothing really fancy. It is also discussed on StackOverflow. You just refactored a huge and complex loop to a more readable stream expression forgetting that some of the method calls throw exception. The method containing this code throws this exception, it is declared in the method head. You do not want to ...

Read More »

What are JAX-RS Annotations? (Part 3)

java-interview-questions-answers

Overview of JAX-RS Annotations (Part 3) This is a three-part series looking at the annotation that is used to implement REST endpoints. In part two of JAX-RS annotations you learnt about: The @Path Annotation and @PathParam The @QueryParamter Annotation The @Produces Annotation The @Consumes Annotation In this part, you will learn more about JAX-RS annotations. Are you ready? let’s get started. ...

Read More »