codecrucible

[Java] Implementing Redis Stream queue in SpringBoot

SpringBoot implements Redis Stream queue Preface Simply implement the method of operating the Redis Stream queue in SpringBoot and monitor the messages in the queue for consumption. jdk:1.8 springboot-version:2.6.3 redis: 5.0.1 (Stream queue is only available in version 5 or above) Preparation 1pom redis dependency package (version 2.6.3) <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId>…

Read More

Simple implementation of Spring state machine

1. What is a state machine? State machine, also known as finite state automaton, is a computing model that represents a limited number of states and behaviors such as transitions and actions between these states. The concept of state machine can actually be applied to various fields, including electronic engineering, linguistics, philosophy, biology, mathematics and…

Read More

Spring multi-threading implementation + reasonable setting of the maximum number of threads and the number of core threads

1. The simplest method: You need to add the @EnableAsync annotation to the Spring Boot main class to enable asynchronous functionality; The @Async annotation needs to be added to the asynchronous method. The sample code is as follows: @SpringBootApplication @EnableAsync public class Application {     public static void main(String[] args) {         SpringApplication.run(Application.class, args);     } } @Service public class AsyncService {     @Async     public void asyncTask() {         // Asynchronous task execution logic     } }…

Read More

SpringSecurity multi-table, multi-terminal account login

This article corresponds to the video SpringSecurity6 multi-terminal account login, which can be extended infinitely. Remember to connect three times, this is very important to me! Warm reminder:Videos and articles complement each other, and the learning effect is stronger when combined! For more video tutorials, please visit Station B [Shi Tian’s Programming Philosophy] SpringSecurity implements…

Read More

SpringJPA does paging condition query

Preface: I believe that many of my friends’ projects use the SpringJPA framework. It is very convenient to use jpa for the addition, deletion, modification and query of a single table, but for conditional query and paging, many friends do not often write about it. Today I sorted it out Share it here. Without further…

Read More

springcloud gateway dynamic routing

1.1 Introduction to springcloud gateway Spring Cloud Gateway is the API Gateway in the SpringCloud microservice system produced by Spring. It is an efficient non-blocking gateway built based on Spring5, Project Reactor, and WebFlux. It provides the following functions: a. All request attributes can be used as routing conditions (Routing Predicates) b. Provides a gateway…

Read More

SpringBoot project integrates ACTable to quickly generate database tables from entity classes

1.Installation ACTable dependency     com.gitee.sunchenbin.mybatis.actable     mybatis-enhance-actable     1.5.0.RELEASE Use mybatis-plus to avoid jar package version conflicts. You can refer to the following methods to introduce dependencies.     com.gitee.sunchenbin.mybatis.actable     mybatis-enhance-actable     1.5.0.RELEASE             com.baomidou             mybatis-plus-annotation    …

Read More

SpringBoot integrates Oracle technology

1. Background introduction 1. Background introduction Spring Boot is an excellent framework for building new Spring applications. Its goal is to simplify the work of developers so that they can focus more on business logic instead of worrying about configuration and redundant code. Spring Boot provides many conveniences, such as automatic configuration, embedded servers, Java-based…

Read More