alibaba / alibaba/Sentinel

Sentinel DataSource 是否考虑增加一个基于Spring Resource的数据源

Open
#3,018 0 comments 0 reactions 0 assignees View on GitHub
area/data-source kind/feature
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description
![image](https://user-images.githubusercontent.com/24709538/211230698-54301b46-7da4-4967-aac9-c57f8d7bb9b3.png)

目前sentinel支持的数据源相对比较全面 , 但是似乎对于Spring Resource方式的数据加载没有做支持 (只提供了`FileRefreshableDataSource` 和 `FileInJarReadableDataSource` 两种方式)

主要是Spring Boot 打成Jar包后运行时,不能直接使用读文件的时候去加载文件数据 , 虽然目前提供的`FileInJarReadableDataSource`可以读到Jar里面的文件内容,但`FileInJarReadableDataSource`在Spring Boot中用起来似乎显得很奇怪 (Spring Boot项目需要获取当前自己正在运行的Jar包路径,然后拼接对应的文件地址) , 如果sentinel配置文件是在其他Jar包里面那获取可能就更麻烦了.

https://github.com/alibaba/spring-cloud-alibaba/issues/3033
https://github.com/alibaba/spring-cloud-alibaba/issues/462

### Describe what you expected to happen

是否考虑新增一个支持 Spring Resource 方式的数据源加载方式 , 这样对于Spring Boot项目的对接实际上会友好很多 , 第三方框架要对接sentinel直接传入一个`Resource`对象即可 .

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.