Tag: Spring Boot

Support for Structured Logging is a new Spring Boot feature introduced with the Spring Boot 3.4.0 release. Structured Logging is fairly common to use in distributed environments where you are using some type of consolidated logging. Typically, you will use a JSON log format to allow for easy consolidated log searches with indexing tools such […]Continue reading

Introduction As a Java developer, a common task you’ll encounter is converting between Java objects and JSON. The Jackson library is a powerful and widely used tool for this purpose. Whether you’re building RESTful APIs, microservices, or simply handling JSON data in your application, Jackson’s ObjectMapper class makes it easy to serialize and deserialize Java […]Continue reading

What are Structured Outputs? Using Structured Outputs is an important aspect when interacting with LLMs programmatically. LLMs, by their nature, generate unstructured output. The unstructured output does not work well with programming languages which need structure to understand the data. Through prompting techniques, you can direct the LLM to create a structured output. The format […]Continue reading

A hidden feature of Spring AI is the support of String Templates, aka StringTemplates. StringTemplate is a lightweight Java template engine. It is simple, and easy to use. StringTemplate is a stable project, established in 2007 and now on its 4 major release. Here is an example from the homepage of the Stringtemplate website. On […]Continue reading

Spring AI is the latest project from the Spring Team. Working with Large Language Models (LLMs) has traditionally been the domain of languages such as Python and Javascript. Spring AI is changing this and is enabling integration with generative AI with Java and Spring. In this post, we will take an initial look at using […]Continue reading

JSON Logging in Spring Boot simplifies setup, especially for applications in distributed environments like Kubernetes. Consolidated logging requires searchable logs, often formatted in JSON. Logstash is a popular choice. A basic Logback configuration supports JSON logging, aiding development with profile flexibility. Testing can be done by generating log messages easily.

Spring Web applications and RESTful services contain controllers responsible to process requests and send back responses. At times you might need to perform certain operations on client requests before it reaches the controller. Similarly, you might need to perform operations on responses sent back by controllers to clients. You can achieve this using filters in […]Continue reading

We use scheduling to schedule jobs in a Spring Boot application. For instance, you can implement scheduling to perform some task at a specific time, or repeat after a fixed interval. In this post, you’ll learn how to use the Spring @Scheduled annotation to configure and schedule tasks. Spring Boot @Scheduled Annotation Example Let’s say […]Continue reading

Apache Kafka is an open-source Message Bus that solves the problem of how microservices communicate with each other. Spring for Apache Kafka, also known as spring-kafka. It is a  project that applies core Spring concepts to Kafka-based messaging solutions. Spring-kafka provides templates as high-level abstractions to send and consume messages asynchronously. In this post, you […]Continue reading