Home » Java » Enterprise Java

Enterprise Java

Run method on Spring Boot startup

spring-interview-questions-answers

While developing a spring boot application, sometimes we need to run a method or a piece of code at startup. This code can be anything ranging from, logging certain information to setting up database, cron jobs etc. We cannot just put this code in constructor, because required variables or servies may not be initialized yet. This could lead to null pointers or some ...

Read More »

AWS CodeBuild Error: Unable to access jarfile

java-interview-questions-answers

Using AWS CodeBuild, I was using a buildspec that was to run an executable JAR file to execute JUnit tests. Here is my buildspec: 1 version: 0.2 env:   secrets-manager:     CLIENT_ID: AppSecrets/someapp:CLIENT_ID     CLIENT_SECRET: AppSecrets/someapp:CLIENT_SECRET phases:   install:     runtime-versions:       java: corretto11   build:     commands:       - echo $CLIENT_ID       - echo $CLIENT_SECRET       - java -jar -DclientId=$CLIENT_ID -DclientSecret=$CLIENT_SECRET junit-platform-console-standalone-1.7.0.jar -cp myapp.jar --select-package="com.wall.steve" As you can see, I ...

Read More »

Scylla DB vs Apache Cassandra Overview

java-interview-questions-answers

1. Introduction In this article, let’s take a quick look at the similarities and differences between two NoSql databases, ScyllaDB and Apache Cassandra DB. 2. What’s Scylla DB? Scylla DB is a NoSQL database written in C++ and is Apache Cassandra’s drop-in replacement database. ScyllaDB provides low latency and high throughput at a fraction of the cost of other NoSQL ...

Read More »

REST: Deleting resources

java-interview-questions-answers

In RESTful APIs resources are typically deleted using the HTTP DELETE method. The resource that should be deleted is identified by the request URI. DELETE is an idempotent HTTP operation. Sending the same DELETE request multiple times should only alter the server state once. Deleting single resources Single REST resource are usually identified by URIs containing a unique identifier. For ...

Read More »

How to get Type-Safe and Intuitive Hibernate/JPA Queries by Leveraging Java Streams

A large proportion of Java database applications are using Hibernate/JPA to bridge the gap between Java and SQL. Until recently, we were forced to mix Java and JPQL or to use complex imperative criteria builders to create database queries. Both of these methods are inherently neither type-safe nor very intuitive. The newly launched open-source library JPAstreamer addresses these issues by allowing you ...

Read More »

Richardson Maturity Model and Pizzas

java-interview-questions-answers

The model, developed by Leonard Richardson, attempts to classify an API according to its adherence to the constraints imposed by REST. The more compliant your implementation, the better it fares. There are four levels. The bottom is level 0, which designates the less compliant implementation, and the top is level 3, which is the most compliant and therefore the most ...

Read More »

For gourmets and practioners: pick your flavour of the reactive stack with JAX-RS and Apache CXF

java-interview-questions-answers

When JAX-RS 2.1 specification was released back in 2017, one of its true novelties was the introduction of the reactive API extensions. The industry has acknowledged the importance of the modern programming paradigms and specification essentially mandated the first-class support of the asynchronous and reactive programming for the Client API. But what about the server side? It was not left ...

Read More »