- 需要用到redis依赖
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>1.5.11.RELEASE</version>
</dependency>
- 示例代码
package cn.jishupeng.order_service.controller;
import cn.jishupeng.order_service.domain.Order;
import cn.jishupeng.order_service.service.IOrderService;
import cn.jishupeng.order_service.service.impl.OrderServiceImpl;
import com.netflix.discovery.util.StringUtil;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.spri
#java# 微服务监控报警机制
最新推荐文章于 2024-05-23 17:11:59 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)