Design to Support New Query Parameters in GET Call Through Configurations Without Making Code Changes

With this design support, new query parameters will be as easy as adding a new query parameter as a property in the application's configuration file. Implemented this using Spring Boot framework and MongoDB as the backend database. 

HTTP GET is two types of path parameters and query parameters. In this article, I’m discussing query parameters. Query parameter GET call is a set of parameters that are part of the URL. Query parameters are appended in the URL after the HTTP resource with ? symbol and multiple parameters are concatenated by & symbol. 

Spring Boot for Cloud: Actuator

In previous articles, we talked about some features of Spring Boot that are very useful in the development phase of our system: we described simplified dependency management and API development, for instance. In this article, we are going to cover functionalities that are related to a production environment.

When a Spring Boot application is finally in production, it needs all the tools to manage and monitor it. This is especially important in complex scenarios like those related to microservice systems. Spring Boot provides an effective solution to provide the required functionalities, the Actuator. The Actuator is a Spring Boot module with a set of features available as HTTP or JMX endpoints, or even with a remote SSH shell.

Spring Boot for Cloud: REST API Development

There are two main ways by which microservice applications can interact with each other: REST services and messaging systems. The REST approach is the most common and will be treated in this article. We will see how Spring boot can make the development process of REST APIs fairly easy, with the use of a set of useful annotations and some implicit background behavior, like the serialization of model objects to JSON format.

Another important issue is related to the documentation and sharing of APIs, and we will see that these concerns are addressed effectively with a solution named Swagger. Integrating Swagger with Spring Boot allows us to generate the documentation from the source code, as a Swagger JSON file, and even browse and manage all the exposed REST services with a web user interface.

Spring Boot for Cloud: Configuration and Dependencies

The natural choice to implement a micro-service application in the realm of the Spring framework would be to use the Spring Cloud set of modules. But those modules cannot work without a solid platform underneath. Spring Boot sits on top of the Spring framework and is an effective base for Spring Cloud libraries (from this consideration the title of this article "Spring Boot for Cloud" makes some sense).  

Spring Boot has some features that can be of great help in reducing the complexity of micro-service architectures:

How To Validate JSON Request Body in Spring Boot

We sometimes encounter server errors caused by a user providing input that's longer than the database column size or even a non-existent ENUM value. Do not trust user input is a popular cliche that, if implemented, will save a lot of time and resources down the line.

That is why, in this article, we will be looking at the request-validator library, which is able to compare the user input against a pre-defined set of rules and return errors if any.

Develop a Full-Stack Java Application With Kafka and Spring Boot

What You Will Build

You will build a full-stack reactive web app that sends and receives messages through Kafka. The app uses Spring Boot and Java on the server, Lit and TypeScript on the client, and the Hilla framework for components and communication.

What You Will Need

  • 20 minutes
  • Java 11 or newer
  • Node 16.14 or newer
  • An IDE that supports both Java and TypeScript, such as VS Code.

Technology Overview

Kafka

Apache Kafka is a distributed event streaming platform. You can think of it as a publish/subscribe system on steroids. Kafka producers can send messages to a topic, and consumers can then read those messages. However, unlike most pub/sub systems, the messages do not get removed from the topic when you read them. This allows you to perform stream processing to analyze, aggregate, or transform data from different events in real-time.

WebRTC Video Calls With Angular and Spring Boot

WebRTC video calls have been added to the AngularPwaMessenger project. The back end supports WebSocket connections that are secured by JWT tokens to enable WebRTC signaling. The current browsers support video calls with WebRTC. The Angular front end supports the WebRTC calls and needs to access the camera and the microphone. The browsers need to be able to connect to each other directly and use the server backend to do that. That means that home/company networks that prevent incoming connections prevent the creation of a video call. Installing the PWA on a smartphone does work because no router/firewall stops the connections. For development, a setup with a self-signed certificate is used that enables testing inside a firewalled network.

WebRTC Documentation

The Mozilla Development Network has WebRTC documentation. The WebRTC protocol is documented here and the AngularPwaMessenger backend provides a STUN server implementation for the ICE protocol. The signaling and video calls are documented here. The diagrams/code show the creation of the connection for the video call.

Reactive Kafka With Streaming in Spring Boot

The AngularAndSpring project uses Kafka for the distributed sign-in of new users and the distributed token revocation for logged-out users.

System Architecture

The AngularAndSpring project needs to be able to be horizontally scaled each with its own database. To enable that, a sign-in needs to be propagated to all instances. Kafka serves as a central event streaming platform to send the sign-in events. Kafka is horizontally scalable to high event loads and can be set up to be highly available.

Building Microservices Using Spring Boot, HarperDB, and AWS

Introduction

In this article, you will learn how to use Spring Boot and HarperDB to create a microservice. Later on, you will also look at how to deploy the complete application on AWS Elastic Beanstalk.

You will be building an Employee Leave Management System. This application will be responsible for tracking the detailed record of employees' leaves. You will also be implementing the functionality to add, edit, and cancel leaves.

Learn How to Use Vue and Spring Boot to Create a Single-Page App

In this tutorial, you'll create a single-page application (SPA) with a Spring Boot resource server and a Vue front-end client. You'll learn how to utilize JSON Web Tokens (JWTs) for authentication and authorization, using Spring Boot to configure the JWTs, with Okta as your OAuth 2.0 and OpenID Connect (OIDC) provider. You'll also learn how to use the Vue CLI to bootstrap a Vue client app and how to secure it using the Okta Sign-In Widget.

Okta is a computer security service provider with helpful information for safeguarding online applications. The Okta Sign-In Widget provides protection for front-end apps by letting you quickly add a secure login form that can be configured for single sign-on and social sign-on with external providers like Google, Facebook, and LinkedIn. It includes a PKCE implementation of the OAuth 2.0 authorization code flow (Proof Key for Code Exchange).

Spinnaker Meets Minikube: Part 2

Introduction

In the previous article, we installed Spinnaker on a Minikube cluster running on Windows 10. In this article, we will add GitHub as a data provider for a Spinnaker pipeline to continuously deploy a dockerized Spring Boot microservice onto the Minikube cluster. The pipeline will be triggered using a Cron job and can be templated so that all one's micro-services are automatically deployed to have a fully up-to-date local development environment at all times. 

Requirements

An understanding of Spring Boot, Github, and Docker Hub is presumed. However, fall-back instructions will be given for those that want to follow a lighter track that pulls the Docker image from the author's registry. However, certain things like proper artifact binding might not work as expected should the full guide not be followed.

Metrics 2.X in Spring Boot 2.X

Spring Boot offers a metrics endpoint that you can use diagnostically to analyze the metrics gathered by the application.

Adding the Dependency Inside POM Is the First Step

A meter is an interface for gathering a bunch of estimations (which we separately call measurements) about your application. spring-measurements loads with an upheld set of Meter natives including Timer, Counter, Gauge, DistributionSummary, and LongTaskTimer. Note that diverse meter types bring about an alternate number of measurements. For instance, while there is a solitary metric that addresses a Gauge, a Timer estimates both the number of coordinated occasions and the absolute season of all occasions planned.

Runners in Spring Boot

Runners is a java class/spring beans of Spring boot Application implement the XXXRunner(I) directly or indirectly, and its auto-executable component is called by Container.

Runner classes are used to deal with one-time executing logics and those logics will be executed where SpringApplication.run(-) is about to complete all of its startup activities.

Introduction to Spring Boot and JDBCTemplate: Refactoring to SpringData JPA

Refactoring is the process of modifying a software system without changing its desirable behavior. It was necessary to have an application integrated with the relational database using the Spring JDBC Template in the first parts. The Spring JDBC Template is a powerful tool that facilitates productivityHoweverthere is a way to simplify the code even further with Spring Data JPA. The purpose of this post is to refactor the project to use Spring Data JPA.

Spring Data JPApart of the larger Spring Data family, makes it easy to implement JPA-based repositories easilyThis module deals with enhanced support for JPA-based data access layers. It makes it easier to build Spring-powered applications that use data access technologies.

Spring Boot on Quarkus: Magic or Madness?

Quarkus is a Java stack tailored for OpenJDK HotSpot (or OpenJ9 on zSeries) and GraalVM, crafted from optimized Java libraries and standards. It is a good choice for building highly-scalable applications while using lower amounts of CPU and memory resources than other Java frameworks. These applications can be traditional web applications, serverless applications, or even functions as a service.

There are many documented instances of organizations migrating their applications to Quarkus. In this article, let's see one such migration path from Spring Boot to Quarkus that is part magic and part madness! The magic will be some hand waving and performing the migration without changing a single line of code. The madness will be trying to figure out how it was done.

Upgrading a Maven, Spring Boot, and JavaFX Application

I've been migrating all my JavaFX applications to Java 15/JavaFX 15.0.1 to see if there are any pain points or gotchas to be aware of. I particularly wanted to understand how Maven and Gradle handle JavaFX, and how to successfully build and run the applications in IntelliJ IDEA.

In this blog post, I explore the steps taken to upgrade a Spring Boot/Maven/JavaFX application.