Netty HttpServer api改变/与可用示例不同(Netty HttpServer api changed/differs from available examples)
Arjen Poutsma的博客文章和Josh Long的视频示例中的 Netty服务器实例化是通过创建一个
reactor.ipc.netty.http.HttpServer
实例,然后使用ReactorHttpHandlerAdapter
实例作为参数调用它的start
或startAndAwait
方法来完成的。然而,API似乎已经改变,因为现在
start
和startAndAwait
方法现在期望具有以下签名的lambda:java.util.function.Function<? super reactor.ipc.netty.http.HttpChannel,? extends org.reactivestreams.Publisher<java.lang.Void>>
项目依赖项及其版本与Arjen Poutsma的示例项目中的相同
<dependency> <groupId>org.reactivestreams</groupId> <artifactId>reactive-streams</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-core</artifactId> <version>3.0.3.RELEASE</version> </dependency> <dependency> <groupId>io.projectreactor.ipc</groupId> <artifactId>reactor-netty</artifactId> <version>0.5.2.RELEASE</version> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> <version>8.5.4</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web-reactive</artifactId> <version>5.0.0.BUILD-SNAPSHOT</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.2</version> </dependency>
使用spring reactor支持实例化netty服务器的新/正确方法是什么?
Netty server instantiation in Arjen Poutsma's blog post and Josh Long's video example is done by creating an
reactor.ipc.netty.http.HttpServer
instance and then calling it'sstart
orstartAndAwait
method with anReactorHttpHandlerAdapter
instance as an argument.However the API seems to have changed as now
start
andstartAndAwait
methods now expect a lambda with the following signature:java.util.function.Function<? super reactor.ipc.netty.http.HttpChannel,? extends org.reactivestreams.Publisher<java.lang.Void>>
Project dependencies and their versions are the same as in Arjen Poutsma's example project
<dependency> <groupId>org.reactivestreams</groupId> <artifactId>reactive-streams</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-core</artifactId> <version>3.0.3.RELEASE</version> </dependency> <dependency> <groupId>io.projectreactor.ipc</groupId> <artifactId>reactor-netty</artifactId> <version>0.5.2.RELEASE</version> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> <version>8.5.4</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web-reactive</artifactId> <version>5.0.0.BUILD-SNAPSHOT</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.2</version> </dependency>
What is the new/proper way of instantiating a netty server with spring reactor support?
原文:https://stackoverflow.com/questions/40830340
满意答案
我想当我们升级到rails 3.2时我也遇到过这个问题。 我得到的错误是由延迟作业使用的yaml处理程序引起的。 尝试将以下内容添加到
config/boot.rb
require 'rubygems' require 'yaml' YAML::ENGINE.yamler = 'syck'
Just in case anyone ever runs into this issue. I figured out the cause was some of the jobs were injected with an older version of Delayed Job. So when the newer Delayed Job attempted to process them, it was unable to deserialize the handler.
相关问答
更多延迟作业反序列化错误,无法加载:分配器未定义为Proc(Delayed Job DeserializationError, failed to load: allocator undefined for Proc)
无法弄清楚onMouseOver(Cannot figure out onMouseOver)
无法弄清楚NullPointerException来自哪里(Can't figure out where NullPointerException comes from)
手动重试作业在Delayed_job(Manually Retry Job in Delayed_job)
我无法弄清楚strcpy(I can't figure out strcpy)
无法弄清楚分段错误(Cant figure out segmentation fault)
我无法弄清楚这个ConcurrentModificationException(I can't figure out this ConcurrentModificationException)
无法弄清楚Delayed :: DeserializationError(Can't figure out Delayed::DeserializationError)
无法弄清楚如何创建这个if语句(Cannot figure out how to create this if statement)
弄清楚可以抛出的所有可能的异常?(Figure out all possible exceptions that can be thrown?)
相关文章
更多[Netty 1] 初识Netty
Netty开发环境配置
Netty源码分析
Netty基于流的传输处理
Netty入门实例-时间服务器
在Twitter,Netty 4 GC开销降为五分之一
Netty环境配置
storm学习之Netty代替ZMQ
Netty入门实例-编写服务器端程序
利用SolrJ操作solr API完成index操作
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!