Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

 

and many more ....

 

 

What is javax.ws.rs.core.context? [ Part 2 ]

java-interview-questions-answers

How to use the @Context annotation In part 1 of What is javax.ws.rs.core.context? you learnt how to use the @Context annotation to retrieve HTTP Header information from an injected instance of the HttpHeaders class and how to retrieve URI information from the UriInfo instance such as URI parameters and variables. In this article, you will learn about using the @Context annotation with the ...

Read More »

Spring Cloud Tutorials – Auto Refresh Config Changes using Spring Cloud Bus

java-interview-questions-answers

Problem In the previous article Introduction to Spring Cloud Config Server(http://sivalabs.in/2017/08/spring-cloud-tutorials-introduction-to-spring-cloud-config-server/) we have seen how to use Spring Cloud Config Server. But, the problem is to reload the config changes in Config Client applications we need to trigger /refresh endpoint manually. This is not practical and viable if you have large number of applications. Solution Spring Cloud Bus module can be used to link ...

Read More »

Spring Cloud Tutorials – Introduction to Spring Cloud Config Server

java-interview-questions-answers

Problem SpringBoot provides lot of flexibility in externalizing configuration properties via properties or YAML files. We can also configure properties for each environment (dev, qa, prod etc) separately using profile specific configuration files such as application.properties, application-dev.properties, application-prod.properties etc. But once the application is started we can not update the properties at runtime. If we change the properties we need to restart the application ...

Read More »

1.x to 2.x migration: Observable vs. Observable: RxJava FAQ

The title is not a mistake. rx.Observable from RxJava 1.x is a completely different beast than io.reactivex.Observable from 2.x. Blindly upgrading rxdependency and renaming all imports in your project will compile (with minor changes) but does not guarantee the same behavior. In the very early days of the project Observable in 1.x had no notion of backpressure but later on backpressure was included. What does it actually ...

Read More »

What is javax.ws.rs.core.context? [ Part 1 ]

java-interview-questions-answers

How to use the @Context annotation The JAX-RS API provides a very handy mechanism to inject a range of useful resources, such as HTTP Headers, into your endpoint. The @Context annotation is an all purpose annotation that injects instances of the following objects: HttpHeaders -> HTTP header parameters and values UriInfo -> Captures path variables and query parameters SecurityContext -> Provides access to ...

Read More »

Concourse caching for Java Maven and Gradle builds

Concourse CI 3.3.x has introduced the ability to cache paths between task runs. This feature helps speed up tasks which cache content in specific folders – here I will demonstrate how this feature can be used for speeding up maven and gradle based java builds. The code and the pipeline that I am using for this post is available at my github repo here – ...

Read More »

Default and private methods in Interfaces

In this tutorial we will look at default and private methods within interfaces. Default methods were added in Java 8 allowing methods to be added to an interface that comes with a default implementation that could be used, overridden or ignored without causing issues to existing classes that have implemented an interface. Private methods were missing when default methods were ...

Read More »

How to convert a lambda expression to method reference in Java 8?

If you have been coding in Java 8 then you know that using method reference in place of lambda expression makes your code more readable, hence it is advised to replace lambda expression with method reference wherever possible, But, the big question is, how do you find whether you can replace a lambda with method reference? Yes, it’s not that easy, ...

Read More »