Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo是否有对文件上传下载导入导出的支持 #11515

Closed
guipengfei opened this issue Feb 9, 2023 · 2 comments
Closed

dubbo是否有对文件上传下载导入导出的支持 #11515

guipengfei opened this issue Feb 9, 2023 · 2 comments

Comments

@guipengfei
Copy link

项目当前架构:
HTTP请求 -> 网关SpringCloudGateway -> 网关路由匹配 -> 网关dubbo泛化调用 -> dubbo服务

但与文件相关的操作,还是需要以Controller的形式暴露服务,因为涉及HttpServletResponse、ModelAndView、MultipartFile这些对象,如:
@PostMapping("/upload")
public Result uploadFile(@RequestParam("file") MultipartFile file) {
......
}

**问题:**请问dubbo可支持文件类型的操作,向外暴露服务,从而去除掉controller ?

@AlbumenJ
Copy link
Member

对于大文件类型的操作,我们建议在首次接收到 MultipartFile 请求之后将文件存储到 HDFS 或者 OSS 等存储介质上,然后在后端传递的时候直接通过一个标识符传递。对于小文件,将 file 转换成 byte 数组传递就行。

@songxiaosheng
Copy link
Member

这个想的有点大,dubbo专注于分布式式RPC框架,如果把MVC功能,或者消息堆积之类的功能都实现了,就不太好专注于RPC,想的大一些其实可以考虑一些子项目Dubbo-MVC, Dubbo-MQ ,Dubbo-Framework 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants