Table of Contents SummarizingTokenWindowChatMemoryThe Summarizer InterfaceSummarization LogicLLM SummarizationWhy This MattersConclusion LLM chat models have become an integral part of many applications today. We are all experimenting and exploring the best ways to utilize them effectively. For Java developers, LangChain4j has …
-
Java 24 : What’s New?
Table of Contents JEP 404: Generational Shenandoah (Experimental)JEP 450: Compact Object Headers (Experimental)JEP 472: Prepare to Restrict the Use of JNIJEP 475: Late Barrier Expansion for G1JEP 478: Key Derivation Function API (Preview)JEP 479: Remove the Windows 32-bit x86 PortJEP …
-
Sliding Window Counter Rate Limiter (Redis & Java)
Table of Contents IndexHow It Works1. Define a Time Window2. Track Requests3. Remove Expired Intervals4. Rate Limit CheckHow to Implement It with Redis1. Track Requests by Sub-Interval2. Remove Expired Intervals3. Sum Counts for the Active WindowImplementing it with JedisAdd Jedis …
-
Building a Declarative API with Spring AOP and SpEL
Table of Contents A story about legacyEvaluating SpEL expressionsImplementing the audit adviceTesting the audit aspectImprovementsFootnotes In this article, we’ll implement a declarative API to perform tasks belonging to cross-cutting concerns, using auditing as an example. We’ll see how SpEL and …
-
Sliding Window Log Rate Limiter (Redis & Java)
Table of Contents How It Works1. Define a Time Window2. Track Requests3. Remove Expired Entries4. Rate Limit CheckHow to Implement It with Redis and Java1. Log Each Request (If Allowed)2. Remove Expired Entries3. Count Requests in the Time WindowImplementing it …
-
Token Bucket Rate Limiter (Redis & Java)
Table of Contents How It Works1. Define a Token Refill Rate2. Track Token Consumption3. Refill Tokens4. Rate Limit CheckHow to Implement It with Redis and Java1. Retrieve current token count and last refill time2. Refill tokens if necessary and update …
-
Receiving Mails in Java with IMAP or POP3
Table of Contents Receiving mailsConnecting to the ServerProcessing MailsSanitizing received MailsUsageTesting I was recently in need to write some small demo project which was receiving and processing mails. There is a lot of documentation for sending mails, but gathering information …
-
Challenge yourself with Application Observability Code Challenges
Table of Contents What are the Application Observability Code Challenges?GoalsWhat do the code challenges look like?Your own stackOnline environment(s)The first challenge🛠️ How to Get StartedChallenge details Code challenges are a nice way to challenge yourself with programming, resulting in some …
-
Fixed Window Counter Rate Limiter (Redis & Java)
Table of Contents How It Works1. Define a Window Interval2. Track Requests3. Reset Counter:4. Rate Limit Check:How to Implement It with Redis and Java1. Use the INCR command to increment the counter in Redis each time a request is allowed2. …
-
Make the Life of your Developer Client’s Easier with Smart Object Builders
Table of Contents The scenario: The complex objectThe traditional approach: Telescoping constructorsFavor Static Factory Methods over Class ConstructorsMany parameters? Use the Builder patternRestricts the order of method calls in the Builder patternConclusionKey TakeawaysFinal Thoughts We often hear the phrase: “Make …
-
The Proper Way to Define Configuration Properties in Spring
Upgrading from Spring Boot 2 to 3 forced me to define my configuration properties in a better way.