Home » Author Archives: Biju Kunjummen (page 4)

Author Archives: Biju Kunjummen

Using Java 8 CompletableFuture and Rx-Java Observable

java-logo

I wanted to explore a simple scatter-gather scenario using Java 8 CompletableFuture and using Rx-Java Observable. The scenario is simple – Spawn about 10 tasks, each returning a string, and ultimately collect the results into a list. Sequential A sequential version of this would be the following: public void testSequentialScatterGather() throws Exception { List<String> list = IntStream.range(0, 10) .boxed() .map(this::generateTask) ...

Read More »

Learning Spring-Cloud – Writing a microservice

spring-interview-questions-answers

Continuing my Spring-Cloud learning journey, earlier I had covered how to write the infrastructure components of a typical Spring-Cloud and Netflix OSS based micro-services environment – in this specific instance two critical components, Eureka to register and discover services and Spring Cloud Configuration to maintain a centralized repository of configuration for a service. Here I will be showing how I ...

Read More »

Learning Spring-Cloud – Infrastructure and Configuration

spring-interview-questions-answers

I got a chance to play with Spring-Cloud to create a sample set of cloud ready microservices and I am very impressed by how Spring-Cloud enables different infrastructure components and services to work together nicely. I am used to creating microservices based on Netflix OSS based stack and typically in a Netflix stack Eureka is considered the hub using which ...

Read More »

Rx-netty and Karyon2 based cloud ready microservice

java-interview-questions-answers

Netflix Karyon provides a clean framework for creating cloud-ready micro-services. In your organization if you use the Netflix OSS stack consisting of Eureka for service registration and discovery, Archaius for property management, then very likely you use Karyon to create your microservices. Karyon has been undergoing quite a lot of changes recently and my objective here is to document a ...

Read More »

Akka samples with scala and Spring

akka-logo

I was looking around recently for Akka samples with Spring and found a starter project which appeared to fit the bill well. The project however utilizes Spring-Scala which is an excellent project, but is no longer maintained. So I wanted to update the sample to use core Spring java libraries instead. So here is an attempt on a fork of ...

Read More »

Netflix Archaius for property management – Basics

java-interview-questions-answers

Netflix Archaius provides a neat set of features to load dynamic properties into an application. This blog post is just a documentation of the extent of Archaius that I have understood, there is much more to it than I have documented here, but this should provide a good start:     Default Behavior Consider a simple properties file: stringprop=propvalue listprop=value1, ...

Read More »

Spring-session demonstration using docker-compose

spring-interview-questions-answers

I have earlier written about an exciting new project called Spring-session which provides a clean way to externalize user sessions for java based web applications. I managed to get a good demonstration set-up for spring-session using docker-compose which shows off the strengths of this project and I wanted to write about this here. In short, this is the set-up that ...

Read More »

Spring Enable annotation – writing a custom Enable annotation

spring-interview-questions-answers

Spring provides a range of annotations with names starting with Enable*, these annotations in essence enable certain Spring managed features to be activated. One good example of such an annotation is EnableWebMvc which brings in all the beans needed to support a MVC flow in Spring based applications. Another good example is the EnableAsync annotation to activate beans to support ...

Read More »

Hot and cold rx-java Observable

java-logo

My own understanding of Hot and Cold Observable is quite shaky, but here is what I have understood till now! Cold Observable Consider an API which returns an rx-java Observable: import obs.Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import rx.Observable; import rx.schedulers.Schedulers; public class Service1 { private static final Logger logger = LoggerFactory.getLogger(Service1.class); public Observable<String> operation() { return Observable.<String>create(s -> { logger.info("Start: ...

Read More »

Using rx-java Observable in a Spring MVC flow

spring-interview-questions-answers

Spring MVC has supported asynchronous request processing flow for sometime now and this support internally utilizes the Servlet 3 async support of containers like Tomcat/Jetty. Spring Web Async support Consider a service call that takes a little while to process, simulated with a delay: public CompletableFuture<Message> getAMessageFuture() { return CompletableFuture.supplyAsync(() -> { logger.info("Start: Executing slow task in Service 1"); Util.delay(1000); ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns