Home » Java

Java

Spring-Boot 2.1.x and overriding bean definition

spring-interview-questions-answers

I was recently migrating an application from Spring Boot 1.5.X to Spring Boot 2.X and saw an issue with overriding Spring Bean definitions. One of the configurations was along these lines in Kotlin: @Configuration class DynamoConfig { @Bean fun dynamoDbAsyncClient(dynamoProperties: DynamoProperties): DynamoDbAsyncClient { ... } @Bean fun dynampoDbSyncClient(dynamoProperties: DynamoProperties): DynamoDbClient { ... } } Now, for a test I wanted ...

Read More »

Using JUnit 5 In Pre-Java 8 Projects

This post demonstrates how JUnit 5 can be used in pre-Java 8 projects and explains why it could be a good idea. JUnit 5 requires at least Java 8 as runtime environment, so you want to update your whole project to Java 8. But sometimes there exists reason why you can’t immediately update your project to Java 8. For example, ...

Read More »

How much faster is Java 11?

Java 11 was released some time ago, although the majority of developers stay on Java 8. Let’s see which one of them is faster for OptaPlanner. The best way to find out is of course running OptaPlanner benchmarks. This article is a follow up on our similar article for Java 8. Benchmark methodology To run the benchmark we used: A stable machine without ...

Read More »

Using Minimum Fractional Digits with JDK 12 Compact Number Formatting

The post “Compact Number Formatting Comes to JDK 12” demonstrated the support added to NumberFormat in JDK 12 to support compact number formatting. The examples shown in that post only used the instances of NumberFormat returned by invocations of NumberFormat‘s new overloaded getCompactNumberInstance(-) methods and so therefore did not specify characteristics such as minimum fractional digits and maximum fractional digits. ...

Read More »

Using Apache Ignite thin client – Apache Ignite insider blog

java-interview-questions-answers

From the version 2.4.0, Apache Ignite introduced a new way to connect to the Ignite cluster, which allows communication with the Ignite cluster without starting an Ignite client node. Historically, Apache Ignite provides two notions of client and server nodes. Ignite client node intended as lightweight mode, which does not store data (however, it can store near cache), and does ...

Read More »

Bootiful Development with Spring Boot and Vue

spring-interview-questions-answers

“I love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. Vue is a web framework that’s gotten a lot of attention lately because it’s lean and mean. Its baseline framework cost is around 40K and is known ...

Read More »

Different States of Java Threads

Introduction In Java, threads can have States. The Thread.State enum defines the different states that a Java thread can have. This enum defines the following values – NEWRUNNABLEBLOCKEDWAITINGTIMED_WAITINGTERMINATED In the subsequent sections, I provide a brief overview of these states along with possible transitions between them. States of a Java Thread NEW This is the default state a thread gets ...

Read More »

Certificate Transparency Verification in Java

java-interview-questions-answers

So I had this naive idea that it would be easy to do certificate transparency verification as part of each request in addition to certificate validity checks (in Java). With half of the weekend sacrificed, I can attest it’s not that trivial. But what is certificate transparency? In short – it’s a publicly available log of all TLS certificates in ...

Read More »