ICode9

精准搜索请尝试: 精确搜索
  • java-带@EnableWebFlux批注的SpringWebFlux错误2019-12-11 06:03:03

    我正在使用Spring Boot 2.1.1版本并使用@EnableWebFlux,但出现了一些错误. 错误是 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.reactive.config.DelegatingWebFluxConfiguration': Initialization of bea

  • java-为什么当响应具有HTTP错误状态代码时,为什么只允许一个连接允许订阅者?2019-12-11 06:02:10

    在休息请求中,我使用Spring WebClient将另一个请求发送到Web服务,并想将结果返回给调用者: return webClient.post() .uri(url) .body(...) .retrieve() .bodyToMono(String::class.java) .map { ResponseEntity.ok(it) } 现在,Web服务返回了HTTP错误状态代码,我收到以

  • java-如何使用Spring WebClient禁用cookie2019-12-11 05:03:48

    有谁知道在Spring WebClient中是否有使用Reactor Netty HttpClient禁用cookie管理的方法? 我注意到WebClient.Builder和HttpClient API都提供了一种将cookie添加到出站请求的方法,但是我正在寻找一种方法来完全禁止它们(如果存在).类似于在Apache的HttpComponentClientBuilder上禁用

  • java-Spring http / web forward无法与spring-active一起使用2019-11-18 01:10:09

    我正在尝试将一个控制器的请求转发到另一个控制器,但是却出现异常 java.lang.IllegalStateException: Could not resolve view with name ‘forward:/test2’. at org.springframework.web.reactive.result.view.ViewResolutionResultHandler.lambda$resolveViews$5(Vie

  • java-如何使用Spring 5 Reactive WebSocket检测断开连接的客户端2019-11-11 06:10:38

    我设法使用Spring 5 Reactive WebSocket支持(Chapter 23.2.4)创建了一个WebSocketHandler.接收和发送一切正常.但是,我不知道如何检测客户端断开连接.调试客户端断开连接时,它会在HttpServerWSOperations类(netty.http.server包)的服务器端停止,并在其中检测到CloseWebSocketFrame.

  • java-为什么我的SecurityWebFilterChain没有被调用?2019-11-10 15:29:36

    我刚刚开始学习Spring的新反应式编程模型,因此我试图编写一个非常基本的Web服务. 这是我的应用程序配置: @SpringBootApplication @EnableWebFluxSecurity public class ReactiveSpringApplication { public static void main(final String[] args) { SpringApplicati

  • 如何在Spring Webflux中重定向请求?2019-11-09 02:19:54

    如何在Spring WebFlux中创建重定向Rest Web服务? WebFlux中似乎还没有重定向功能! 我想要这样的东西: @Bean RouterFunction<ServerResponse> monoRouterFunction() { return route(GET("/redirect/{id}"),{ req -> req.Redirect( fetchAUrlFromDataBase()

  • java-在RestController方法中获取ServerWebExchange2019-11-08 19:03:40

    如何在控制器方法中获取ServerWebExchange或反应式ServerHttpResponse? 在尝试调用接受ServerWebExchange的rest控制器方法时,我一直在获取NestedServletException. 我的控制器如下所示: @RestController @RequestMapping(path = "/path/{param1}/path", produces = MediaType.APPLI

  • java-无法通过spring web reacting显示背压2019-10-26 08:03:38

    我正在尝试使用spring-web-active来显示背压,就像在akka中显示它的方式-https://www.youtube.com/watch?v=oS9w3VenDW0 (在28:20至29:20之间观看). 要尝试一下,我使用了以下来自github https://github.com/bclozel/spring-boot-web-reactive的示例项目 设置项目后,我在HomeControll

  • Spring Web Flux反应服务器发送事件=无限循环?2019-10-25 19:19:26

    我正在使用Spring Web Flux Reactive,MongoDB和Angular构建实时事件流应用程序(例如股票价格).我想建立以下管道:MongoDB->反应性MongoDB驱动程序-> Spring Web Reactive MongoDB存储库-> Spring Web反应控制器->角度(通过服务器发送事件). 这是我的Spring Web反应控制器: @GetMappi

  • java-如何使用WebClient执行零拷贝上传和下载?2019-10-25 17:03:02

    您可以使用org.springframework.web.reactive.function.client.WebClient使用Spring 5 WebFlux执行零拷贝上传和下载吗?解决方法:没错,从基于文件的资源发布数据时,现在支持零拷贝. 因此,以下内容正确无误: client.post() .body(BodyInserters.fromResource(new FileSystemRes

  • 如何使用Spring Boot WebClient收集分页的API响应?2019-10-24 23:29:06

    我有一个来自URL的分页响应,我想继续点击从上一个响应中获得的下一个页面URL,并继续收集项目,直到我的响应中没有“ nextPage” URL.如何使用WebFlux的Spring Boot WebClient以无阻碍的方式以反应方式实现此目标? Request1: GET /items response: { items:

  • 使用Spring WebClient解码内容编码gzip2019-10-24 21:29:05

    我正在使用Spring WebClient(Spring 5.1.3)调用Web服务.服务以内容类型响应:application / json和内容编码:gzip 然后,ClientResponse.bodyToMono失败,并显示错误“ JSON解码错误:非法字符((CTRL-CHAR,代码31))”,我认为这是因为在尝试解析JSON之前尚未对内容进行解码. 这是我如何创建

  • Spring Boot WebClient.Builder bean在传统servlet多线程应用程序中的用法2019-10-12 05:21:51

    我想有一个http客户端从Spring Boot不响应的应用程序调用其他微服务.由于将不使用RestTemplate,因此我尝试使用WebClient.Builder和WebClient.虽然我不确定线程​​安全性.这里的例子: @Service public class MyService{ @Autowired WebClient.Builder webClientBuilder;

  • 使用Spring Webflux Reactive WebClient设置连接超时2019-10-08 13:20:49

    为(默认)WebClient设置(连接)超时的正确方法是什么? 仅仅对生成的Mono(或Flux)使用Mono #timetime(Duration)方法是否足够?或者这是否会导致内存/连接泄漏? 提前致谢! (Spring 5 webflux how to set a timeout on Webclient的答案不起作用!)解决方法:从Reactor Netty 0.8和Spring Framew

  • spring – 如何使用WebClient限制请求/秒?2019-10-08 12:22:32

    我正在使用WebClient对象将Http Post请求发送到服务器. 它正在快速发送大量请求(QueueChannel中有大约4000条消息).问题是……似乎服务器响应速度不够快……所以我得到了很多服务器错误500和connexion过早关闭. 有没有办法限制每秒的请求数量?或者限制它使用的线程数量? 编辑: QueueCh

  • Java – Spring Web-Flux中的Backpressure机制2019-10-03 22:11:15

    我是Spring Web-Flux的首发.我写了一个控制器如下: @RestController public class FirstController { @GetMapping("/first") public Mono<String> getAllTweets() { return Mono.just("I am First Mono") } } 我知道其中一个反应性好处是Backpress

  • 使用非流应用程序/ json的Spring WebFlux Flux行为2019-10-02 09:21:04

    我正在使用Spring Webflux进行评估,但我们必须支持期望application / json的客户端,而不是application / stream json.我不清楚Spring WebFlux如何处理需要application / json的客户端序列化Flux. 如果一个Flux被序列化为application / json而不是application / stream json,它是一

  • java – Spring MVC(async)vs Spring WebFlux2019-09-30 17:01:03

    我正在尝试了解Spring WebFlux.到目前为止我发现的东西都是反应核心,没有Servlet API,没有每个请求的线程,HTTP 2,服务器推送,应用程序/流json. 但是Spring MVC中的异步调用有什么区别?我的意思是在Spring MVC中,当你返回Future,DefferedResult等时,你会在一个单独的线程中执行请求

  • java – Spring netFlux在使用Netty与Tomcat时的不同之处2019-09-26 15:01:11

    我正在学习春天的webflux,我读过以下系列文章(first,second,third) 在第三条中,我面对以下案文: Remember the same application code runs on Tomcat, Jetty or Netty. Currently, the Tomcat and Jetty support is provided on top of Servlet 3.1 asynchronous processing

  • Spring 5 webflux如何在Webclient上设置超时2019-09-26 04:19:36

    我正在尝试在我的WebClient上设置超时,这是当前代码: SslContext sslContext = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build(); ClientHttpConnector httpConnector = new ReactorClientHttpConnector(opt -> { opt.sslContext(

  • 如何等待Spring 5 WebClient完成所有请求?2019-09-10 15:28:35

    我有一个简单的Java程序,它使用Spring WebClient发送多个请求.每个都返回一个单声道,我使用response.subscribe()来检查结果. 但是,我的主要执行线程在处理所有请求之前完成,除非我添加一个长的Thread.sleep(). 使用CompletableFutures,您可以使用:CompletableFuture.allOf(期货).jo

  • 如何查看Postman中Spring 5 Reactive API的响应?2019-08-28 13:19:17

    我的应用程序中有下一个端点: @GetMapping(value = "/users") public Mono<ServerResponse> users() { Flux<User> flux = Flux.just(new User("id")); return ServerResponse.ok() .contentType(APPLICATION_JSON) .bod

  • 在Spring Webflux中返回多个Monos2019-07-31 06:19:23

    我正在尝试使用SpringBoot 2.0和新的反应式webFlux库.我想知道如何将通过无阻塞WebClient进行的两次调用的结果返回给我的Springboot API的调用者.我的代码是: @RequestMapping("/search") public CombinedResults perfomSearch(@RequestParam final String searchTerm) { Mono

  • Java Reactor:如何从stdin生成Flux?2019-07-31 06:00:58

    我想异步读取用户从stdin生成的消息. 就像是: Flux.from(stdinPublisher()) .subscribe(msg -> System.out.println("Received: " + msg)); 那么如何在这里实现这样的stdin发布者呢?解决方法:很容易.对不起打扰:) import java.util.Scanner; import lombok.extern.slf4j.Slf4

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有