baeldung

Configuring Message Retention Period in Apache Kafka

1. Overview When a producer sends a message to Apache Kafka, it appends it in a log file and retains it for a configured duration. In this tutorial, we'll learn to configure time-based message retention properties for Kafka topics. 2. Time-Based Retention With retention period properties in place, messages have a TTL (time to live). Upon expiry, messages are marked for deletion, thereby freeing up the disk space. The same retention...

baeldung

Java Weekly, Issue 372

1. Spring and Java >> JEP-380: Unix domain socket channels [inside.java] Performant, secure, and convenient inter-process communications with Unix domain socket support in Java 16! >> Metrics and Tracing: Better Together [spring.io] Tracing meets metrics – linking Spring Boot metrics and open tracing data for better observability. >> GraalVM Native Image Quick Reference [medium.com] A highlight of the most commonly used and...

baeldung

Java Weekly, Issue 370

1. Spring and Java >> Java 1.0 Turns 25 [infoq.com] Write once, run everywhere turns 25 – a brief history of Java evolution throughout these 25 years! >> Interview with Brian Goetz [manning.com] Becoming the Java language architect – how it was started for Brain Goetz and how it's going! >> Spring Batch on Kubernetes: Efficient batch processing at scale [spring.io] Creating fault-tolerant, robust, cost-efficient, observable,...

baeldung

Java Weekly, Issue 369

1. Spring and Java >> Quarkus 1.11 released – RESTEasy Reactive, Dev UI, and more! [quarkus.io] Fully reactive JAX-RS implementation, Dev UI, enhanced Micrometer support, and many more features in a new Quarkus version! >> Proposal for Primitive Objects for Java [openjdk.java.net] Towards objects without identities – the proposal for primitive and inline objects for the Java platform! >> GraalVM 21.0: Introducing a New Way to Run...

baeldung

How to Convert a Hibernate Proxy to a Real Entity Object

1. Overview In this tutorial, we'll learn how to convert a Hibernate proxy to a real entity object. Before that, we'll understand when Hibernate creates a proxy object. Then, we'll talk about why Hibernate proxy is useful. And finally, we'll simulate a scenario where there's a need to unproxy an object. 2. When Does Hibernate Create a Proxy Object? Hibernate uses proxy objects to allow lazy loading. To better visualize the scenario,...

baeldung

Evaluating a Math Expression in Java

1. Overview In this tutorial, we'll discuss various approaches to evaluate a math expression using Java. This feature could come in handy in projects where we want to evaluate math expressions provided in string format. To begin with, we'll discuss a few third-party libraries and their usage. Next, we'll see how we can use the built-in Java Scripting API to achieve this task. 2. exp4j exp4j is an open-source library that can be used...