Implementing single-machine current limiting based on Spring Boot + Guava

1. What is current limiting Services can sometimes be under great pressure due to frequent network requests, especially those caused by illegal network attacks. Such situations sometimes require some restrictions. Current limiting can be considered a type of service degradation. Current limiting is to limit the input and output traffic of the system to achieve […]

Guava: A comprehensive tool library for Java developers

: Just work hard and leave the rest to time : Xiaopozhan Guava: A comprehensive tool library for Java developers Preface First: What is Guava Overview Advantages of Guava Source code structure Introduce coordinates Second: Guava collection framework Traverse and manipulate collections immutable collection Collection tool class Third: Functional programming with Guava Lambda expressions and […]

Custom annotations for log printing and single-machine guava current limiting

Aop concept: AOP (Aspect Orient Programming): Aspect-oriented programming. Aspect-oriented programming considers the program running process from a dynamic perspective. AOP is the abbreviation of Aspect Oriented Programming, which means: aspect-oriented programming, a technology that can achieve unified maintenance of program functions through runtime dynamic agents. AOP is an important part of the Spring framework. AOP […]

Distributed interface idempotence, distributed current limiting: Guava, nginx and lua current limiting

Reprint: https://mp.weixin.qq.com/s/kRI9iQc695vIeqhkry6RRw Source: blog.csdn.net/qq_34886352/article/details/104694550 update set version = version + 1 ,xxx=${<!– –>xxx} where id =xxx and version = ${<!– –>version}; <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>18.0</version> </dependency> @RestController @Slf4j public class Controller{<!– –> //Two tokens can be created per second RateLimiter limiter = RateLimiter.create(2.0); //Non-blocking current limit @GetMapping(“/tryAcquire”) public String tryAcquire(Integer count){<!– –> //count tokens consumed […]

These Map operations in Guava reduced my code size by 50%

This is a community that may be useful to you One-to-one communication/interview brochure/resume optimization/job search questions, welcome to join the “Yudao Rapid Development Platform” Knowledge Planet. The following is some information provided by Planet: “Project Practice (Video)”: Learn from books, “practice” from past events “Internet High Frequency Interview Questions”: Studying with your resume, spring blossoms […]

How Guava solves log desensitization requirements!

Table of Contents introduction What is Guava? How does Guava handle log desensitization requirements? 1. String replacement 2. String interception 3. Regular expression replacement Summarize Introduction In modern software development, logging is a very important component. It not only helps developers quickly locate and solve problems, but also provides valuable data for analysis and monitoring. […]

High performance current limiter Guava RateLimiter

Today let’s talk about how Guava RateLimiter solves the current limiting problem in high concurrency scenarios. Guava is Google’s open source Java class library, which provides a tool class RateLimiter. Let’s first look at the use of RateLimiter to give you a sensory impression of rate limiting. Suppose we have a thread pool that can […]

Guava cache and Guava thread pool

Guava cache Guava cache is a cache implementation provided in the Google Guava library, which can help us easily implement caching functions in our applications. Guava cache provides some advanced features such as automatic loading, expiration time, maximum cache size, cache recycling, etc. The relationship between CacheBuilder and Guava cache CacheBuilder is the builder of […]

Google Guava application encapsulation in actual scenarios

After all, the scenery of West Lake in June is different from that of the four seasons. The lotus leaves touching the sky are infinitely green, and the lotus flowers reflecting the sun are uniquely red. Farewell to Lin Zifang after leaving Jingci Temple at dawn – Yang Wanli I made an appointment with my […]