Sign in

Full Stack Developer, Manning Author for Spring Boot In Practice book, Technical Writer, Course Creator at Udemy. Find more at https://musibs.github.io

The Querydsl lets us build type-safe queries using its fluent API

Image Courtesy: Unsplash by Ignacio Amenábar

Introduction

The Querydsl is a third-party library that lets us define type-safe queries. It also makes the query generation relatively easy through its fluent DSL APIs. In general, the native SQL or the Java Persistence Query Language (JPQL) does not provide any means to validate the correctness of the queries at compile time. Any query syntax or other issues are detected at run time and cause the application to fail.

In this tutorial, we’ll look into the usage of Querydsl library that lets you do the following:

  • Validate that the entities used in the query exists and can be persisted in…


Spring Boot Actuator lets you monitor and interact with your Spring Boot application. It provides several production-grade features that you can enable in your Spring Boot application at no extra cost.

Introduction

We develop applications and run them in production. Any application running in production requires some amount of monitoring to ensure that the application is in desired health condition. This is not a choice but an absolute need to ensure smooth customer service and to be in business. Organizations spent a ton of money on their application monitoring and management infrastructure to ensure these.

Spring Boot provides Spring Boot Actuator that lets you monitor and interact with applications at no extra cost. Spring Boot Actuator provides several powerful yet easy-to-use features that make application monitoring extremely easy. …


Spring Boot in Practice is a Spring Boot book from Manning Publications due to be released this year. A practical Spring Boot guide that aims to provide a solid foundation on Spring Boot and provides an in-depth discussion on several core Spring Boot features such as auto-configurations, actuator, security, and several new features such as reactive Spring Boot, WebSocket, Kotlin DSLs, GraalVM, and many more.

Spring Boot in Practice is a Spring Boot book that covers dozens of handy Spring Boot development techniques, from basic functions to hidden features you probably didn’t even know existed. Each recipe is built around a real-world problem and shows you how Spring Boot can provide a simple and elegant solution.

In Spring Boot in Practice you will learn:

- A comprehensive introduction to Spring Boot’s features - Configuration management, logging, and monitoring Spring Boot applications - Effective methods for database communication - Utilizing Spring Security and securing your Spring application in production - Designing and developing microservices and RESTful…


Security is no longer an afterthought, it's a must in any application these days.

Image Courtesy: https://unsplash.com/photos/-likB8H-IFk

In the modern era, security is an essential feature in any application, your REST services are no exception to it. In this short tutorial, we’ll discuss how to secure your REST APIs with BASIC authentication. We’ll use Spring Security to implement the security of the API

Application Endpoints

We’ll use a fictitious application that lets us manage our favorite web URLs. Let us call this application Pocket. It has the following endpoints:

GET /pockets: Returns all available pockets

GET /pockets/{id}: Returns the available pocket for the supplied id. Return an error for invalid ids

POST /pockets: Create a new pocket

PUT /pockets…


Consume web services with Spring Boot and Spring Web Services.

Image Courtesy: Unsplash by Casey Horner

Spring Web services is an alternative way to develop document-driven, contract-first SOAP web services. One of the main reasons to use Spring-WS is that it has built-in Spring integration and features such as dependency injection.

In this article, we will demonstrate how to consume a soap web service with Spring boot.

What are we Building?

We are consuming a SOAP web service that provides Medium article details. This web service has only one operation named getArticle. The SOAP request message accepts an article ID of the article and returns the article details in the response. Following is the WSDL definition file:

article.wsdl

Complete source…


Build and Deploy a Spring Boot application in Wildfly Server through Maven

Image Courtesy: Unsplash by JOHN TOWNER

By default, Spring Boot applications are shipped with an embedded tomcat container and packaged as an executable UBER jar. This fat jar can be executed in console without the need for an application server. However, at times we need to package the application as a WAR file and deploy it into a web/application server. In this article, we will discuss how to package a Spring Boot application as a WAR file and deploy it into the WildFly application server.

Setting up WildFly Server

Let us first set up the WildFly application server. This server can be freely downloaded from the WildFly website. Based on…


Design document-driven, contract-first SOAP web services with Spring Boot and Spring Web Services.

Image Courtesy: Unsplash by ᴠɪᴋᴛᴏʀ ꜰᴏʀɢᴀcs

SOAP Web Services (Spring-WS) is an offering from Spring Framework that facilitates creating document-driven, contract-first SOAP web services. One of the main reasons to use Spring-WS is that it has built-in integration with Spring Framework and the ability to leverage major Spring features such as dependency injection. Also, the architecture of Spring-WS resembles that of Spring-MVC and this makes the learning of Spring-WS much easier.

In this article, we will develop a contract-first soap web service with Spring boot. In the development process, we will highlight the core Spring-WS features.

What are we Building?

We are developing a SOAP web service that let users…


Swagger let us document REST APIs and shares with API Users. It also allows us to generate REST stubs for quick prototyping and mocking

Image Courtesy: Unsplash by Andy Art

The popularity of REST Web service is ever-increasing and REST API based application design is the standard in the enterprise space. An API defines a contract between the API publisher and its consumers. This contract includes several aspects of the API; including the endpoints, request-response model, domain objects and so on. Over the last couple of years, Swagger has emerged as the standard to document the REST APIs. Swagger captures the API definitions in JSON or YAML format adhering to the OpenAPI specification. A Swagger document can be shared with API consumers for quick prototyping and mocking.

Swagger also provides…


Functional programming in Java in a better way.

Image Courtesy: Unsplash by Daryan Shamkhali

Java has introduced functional programming support in Java release version 8. This specific release has also introduced several new concepts notably lambda expressions, method reference and a plethora of functional interfaces. While discussing functional interfaces, there are few functional interfaces namely Consumer, Supplier, Predicate and Functions are most crucial. In this article, we will talk about these interfaces.

Consumer

A Consumer is a functional interface that accepts a single input and returns no output. In layman’s language, as the name suggests the implementation of this interface consumes the input supplied to it. Consumer interface has two methods:

void accept(T t); default…


Most frequently used core annotations in Spring application development

Image Courtesy: Unsplash by the_roaming_platypus

Introduction of annotation in Java programming language has changed the way Java developers used to configure their applications. Its introduction in Java 1.5 has empowered application developers to maintain configurations in the source code itself instead of relying on external configuration files. It is a form of syntactic metadata that can be added to Java Source code classes, methods, variables, parameters and packages.

Spring framework let application developer configure applications with a plethora of in-build annotations. In this article, we will focus on a few most frequently used annotations in Spring Core framework.

#1. @Autowired Annotation

This annotation is used to declare a…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store