Best of BaeldungDecember 2024

  1. 1
    Article
    Avatar of baeldungBaeldung·1y

    Implementing an AI Assistant with Spring AI

    This tutorial delves into the features of Spring AI to create an AI assistant using LLMs like ChatGPT. It highlights the key functionalities, including context-aware response generation, structured output conversion, and integrating with Vector DBs. The process involves setting up necessary dependencies, creating relevant tables, and implementing callback functions. Common concerns like data privacy and maintaining conversational states are addressed using Advisors APIs. Examples demonstrate how to build a chatbot in a legacy Order Management System, showcasing practical applications of these concepts.

  2. 2
    Article
    Avatar of baeldungBaeldung·1y

    Introduction to Apache Accumulo

    Apache Accumulo is a powerful, distributed key-value store designed for handling massive datasets with fine-grained security. Developed originally by the NSA and based on Google's Bigtable, it excels in scalability, performance, and security, enabling efficient data ingestion, retrieval, and processing. Accumulo supports cell-level security, server-side programming, and flexible data models, making it ideal for applications requiring strict access controls and large-scale data management.

  3. 3
    Article
    Avatar of baeldungBaeldung·1y

    Exploring Advanced JVM Options

    The Java Virtual Machine (JVM) offers a range of advanced options to fine-tune its performance, manage memory, and conduct diagnostics. These options include configurations for garbage collection, memory management, Just-in-Time (JIT) compilation, and debugging. Developers can achieve optimal application performance by understanding and appropriately using these advanced settings, while also considering potential changes in future JVM versions.

  4. 4
    Article
    Avatar of baeldungBaeldung·1y

    Automated Testing for OpenAPI Endpoints Using CATS

    Explores the use of CATS (Contract Auto Test Service) for automated testing of REST APIs with OpenAPI configurations. CATS generates and runs tests based on the API contract, simplifying the testing process and improving API reliability by identifying potential issues early. Key features include automatic test generation, HTML report creation, and integration with authorization requirements. The post provides a detailed guide on installing CATS, configuring tests, and analyzing test reports to address common API issues.

  5. 5
    Article
    Avatar of baeldungBaeldung·1y

    Mocking Private Fields With Mockito

    Learn how to mock private fields using Mockito in this tutorial. Although Mockito doesn't inherently support it, different approaches such as using Java Reflection API or JUnit 5's ReflectionUtils can achieve this goal. Examples are provided to demonstrate how to set values for private fields and test their methods.

  6. 6
    Article
    Avatar of baeldungBaeldung·1y

    Dynamic Spring Data JPA Repository Query With Arbitrary AND Clauses

    This tutorial explores three approaches to creating dynamic queries in Spring Data JPA repositories: Query by Example, Query by Specification, and QueryDSL. The post provides a detailed setup for each method, including code examples for entity classes, repository definitions, and querying logic. It compares these methods based on their complexity and suitability for different types of queries.

  7. 7
    Article
    Avatar of baeldungBaeldung·1y

    Difference Between Circuit Breaker and Retry in Spring Boot

    In distributed systems, handling failures is crucial for reliability and performance. Two key resilience patterns are Retry and Circuit Breaker. Retry handles transient failures by re-executing operations, while Circuit Breaker prevents repeated attempts at operations likely to fail, protecting against cascading failures. Implementing these patterns in Spring Boot using Resilience4j enhances system stability via features like exponential backoff in Retry and state management in Circuit Breaker. Integrating with Spring Boot, Spring Cloud Circuit Breaker, and Spring Retry, they provide robust frameworks for creating resilient microservices.