Home » Java » Page 9

Java

Avoid leaking domain logic

Many software architectures try to separate domain logic from other parts of the application. To follow this practice we always need to know what actually is domain logic and what is not. Unfortunately this is not always that easy to separate. If we get this decision wrong, domain logic can easily leak into other components and layers. We will go ...

Read More »

Using JaCoCo to measure system test coverage

java-interview-questions-answers

Measuring test coverage of your production code can quickly become a heated topic, especially with regards to which percentage is the right number. In the video, I want to show you a different approach to usual code coverage, one that uses system tests with the application’s endpoints, in order to see how well our test scenarios cover all use cases. ...

Read More »

Logging Side Effects

One would like to assume that turning logging on would have no side effect on the running software. LOGGER.info("The current session is {}", request.getSessionId()); However, there are always ways in which logging can cause more work, or even a state change. In the above, let’s say the getSessionId needed to pull the session id down through the request from some ...

Read More »

Execute mTLS calls using Java

Previously we secured an Nginx instance using SSL and mTLS. If you are using Java interacting with a service secured with mTLS requires some changes on your code base. On this tutorial we shall enable our Java application to use mTLS using different clients. To get started fast, we shall spin up a server exactly the same way we did ...

Read More »

Overhead added by collecting thread dumps

A thread dump is a snapshot of all the threads running in a java process. It’s a vital artifact to troubleshoot various production problems such as CPU spikes, unresponsiveness in the application, poor response time, hung threads, high memory consumption. Thus to facilitate troubleshooting, we have seen enterprises capture thread dumps on a periodic basis (every 5 minute or 2 ...

Read More »

All You Need To Know About Exception Handling In Selenium

In the world of technology, exceptions are said to be as old as programming itself. Occurrence of an exception during the execution of code can result in unexpected behaviour unless the exception is properly handled in the code. Exceptions are not bad, but are a fundamental part of modern programming. Rather than having a fear of exceptions, it is important ...

Read More »

Executing Blocking calls on a Reactor based Application

spring-interview-questions-answers

Project Reactor is a fully non-blocking foundation with back-pressure support included. Although most libraries out there support asynchronous methods thus assist on its usage, there are some cases where a library contains complex blocking methods without an asynchronous implementation. Calling this methods inside a reactor stream would have bad results. Instead we need to make those method to async ones ...

Read More »

Performance impact of java.lang.System.getProperty()

‘java.lang.System.getProperty()’ is a common API used by Java developers to read the System properties that are configured during application startup time. i.e. when you pass “-DappName=buggyApp” as your application’s startup JVM argument, the value of the ‘appName’ system property can be read by invoking the ‘java.lang.System.getProperty()’. Example: public static String getAppName() { String app = System.getProperty("appName"); return app; } When ...

Read More »

KivaKit Microservices

java-interview-questions-answers

KivaKit Microservices   KivaKit is designed to make coding microservices faster and easier. In this blog post, we will examine the kivakit-microservice module. As of this date, this module is only available for early access via SNAPSHOT builds and by building KivaKit. The final release of KivaKit 1.1 will include this module and should happen by the end of October, ...

Read More »