continew-org / continew-admin

🔥Almost最佳后端规范🔥持续迭代优化的前后端分离中后台管理系统框架,开箱即用,持续提供舒适的开发体验。当前采用技术栈:Spring Boot3(Java17)、Vue3 & Arco Design、TS、Vite5 、Sa-Token、MyBatis Plus、Redisson、JetCache、Jackson、Spring Doc、JustAuth、Easy Excel、Crane4j、Liquibase、Hutool 等。
https://continew.top
Apache License 2.0
456 stars 105 forks source link

希望能支持Flux 响应式编程 #80

Closed weirantongxue closed 1 month ago

weirantongxue commented 1 month ago

Feature 描述

在框架使用spring-boot-starter-webflux 无法使用响应式.或者流式输出. 导致集成spring-ai提供的对应start包,也无法使用流式输出.

描述一下您想要的解决方案

我排查了好久,找不到为什么,啊哈哈哈,.我新建一个空的springboot3.0X的项目是可以的. 操作如下.希望大佬有空的时候帮忙看一下.

  1. 新建springboot3.0X
  2. 引入maven
  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
  </dependency>
  1. 编写测试接口
    @GetMapping(value = "/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public Flux<String> stream() {
        return Flux.interval(Duration.ofSeconds(1))
                .map(sequence -> "Flux - " + LocalTime.now().toString());
    }

4.响应输出 image

描述一下您考虑过的替代方案

No response

额外补充

No response

确认

Charles7c commented 1 month ago

之前是因为 log 组件的过滤器导致的问题,ContiNew Starter v2.4.0 给 log 组件新增了一个 excludePatterns 配置,可以放行不需要过滤的路由。