Home » Java (page 4)

Java

Java 11: New HTTP Client API

In Java 11, the incubated HTTP Client API first introduced in Java 9, has been standardised. It makes it easier to connect to a URL, manage request parameters, cookies and sessions, and even supports asynchronous requests and websockets. To recap, this is how you would read from a URL using the traditional URLConnection approach: var url = new URL("http://www.google.com"); var ...

Read More »

Bootiful GCP: Spring Cloud Stream with Google Cloud Pub/Sub

spring-interview-questions-answers

I’ve recently read Josh Long‘s Bootiful GCP series on Sprint Central’s engineering blog and especially liked the 4th part about using Google Cloud’s Pub/Sub. I felt inspired by the series and as I’m also evaluating Spring Cloud Stream for a new project of mine. I thought, I would expand on that article where Josh left off. This article describes how ...

Read More »

Installing OpenJDK 11 on Ubuntu 18.04 for real

OpenJDK 11 was released on the 25th of September, 1018. As this is the first LTS release after version 8, it’s been awaited for long. After having it installed on Ubuntu 18.04 (Bionic Beaver), which comes with a package named openjdk-11-jdk, to my surprise that was still an earlier version (Java 10). SRU exception for OpenJDK The Ubuntu Foundation Team made ...

Read More »

Java: Aggregate Data Off-Heap

Explore how to create off-heap aggregations with a minimum of garbage collect impact and maximum memory utilization. Creating large aggregations using Java Map, List and Object normally creates a lot of heap memory overhead. This also means that the garbage collector will have to clean up these objects once the aggregation goes out of scope. Read this short article and ...

Read More »

Consuming Twitter Streaming API with Spring Integration

spring-interview-questions-answers

1. Overview Spring Integration has been known to have a myriad of connectors for interacting with external systems. Twitter was no exception and for a long time, as Spring Social had been an out-of-the-box solution which Spring Integration leveraged in order to connect to social networks. 1.1 Spring Social EOL Unfortunately, Spring Social has reached its end of life, the ...

Read More »

Security Enhancements in JDK 9, 10 and 11

One of reasons for shorter release cycles of the JDK is possibility to rollout faster security bugfixes and enhancements. In this article we will review in a nutshell what are the major security enhancements introduced in latest JDK versions. As most of these enhancements are related to TLS it is essential to understand the TLS handshake process as illustrated by ...

Read More »

Log Aggregation using ELK Stack

java-interview-questions-answers

1. Introduction With the use of microservices, it has become easy to create stable distributed applications and get rid of many legacy problems. But the use of microservices has introduced a few challenges also and Distributed log management is one of them. As microservices are isolated hence they don’t share database and log files, so it becomes challenging to search, ...

Read More »

Default methods in Java 8, and what it changes in API design

Java 8 introduced default methods in interfaces. This post describes what they are, and how they can change the design of APIs. A nominal design Earlier, in Java, interfaces could only have contracts – method signatures with no implementation. In order to add some implementation, a class was required, whether abstract or not. Hence, traditional API design then followed this hierarchy: The root interface defines the ...

Read More »