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

Support http2 #7

Closed
spencergibb opened this issue Jan 7, 2017 · 41 comments · Fixed by #2363
Closed

Support http2 #7

spencergibb opened this issue Jan 7, 2017 · 41 comments · Fixed by #2363
Projects
Milestone

Comments

@spencergibb
Copy link
Member

No description provided.

@spencergibb
Copy link
Member Author

I believe this is blocked by reactor-netty (@smaldini is that correct?) on the one side and #145 on the other.

@yamen23ali

This comment has been minimized.

@spencergibb

This comment has been minimized.

@medalliaerlich
Copy link

Once reactor-netty 0.8 is released, will it be enough to update netty dependency version?

@spencergibb
Copy link
Member Author

no, there will need to be a corresponding gateway release.

@medalliaerlich

This comment has been minimized.

@spencergibb

This comment has been minimized.

@hero-zhanghao
Copy link

@spencergibb
Do gateway now support HTTP2?I don't have the documentation, or the plan?

@spencergibb
Copy link
Member Author

You will have to watch reactor/reactor-netty#104

@hero-zhanghao
Copy link

I see that reactor netty has already released a version that supports HTTP2, so which version of the gateway is available?

@spencergibb
Copy link
Member Author

It has not

@Inego

This comment has been minimized.

@MilgoTest

This comment has been minimized.

@spencergibb
Copy link
Member Author

It is all based on reactor Netty

@hero-zhanghao
Copy link

What does that mean?This is still blocked by reactor netty, right?

@spencergibb
Copy link
Member Author

spencergibb commented Jun 6, 2019

Yes, it is blocked by reactor Netty

@MilgoTest
Copy link

I didn't think you'd need client side support of Netty for HTTP/2.

@benjamineckstein

This comment has been minimized.

@nabilgasri

This comment has been minimized.

@spencergibb

This comment has been minimized.

@spencergibb
Copy link
Member Author

Looks like this is all unblocked now https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-configure-http2-netty

@DasAmpharos
Copy link

@spencergibb tried enabling HTTP2 in my gateway application. Whenever I attempt to route a gRPC call through the gateway I'm getting the following exception:

java.lang.UnsupportedOperationException: unsupported message type: DefaultHttpRequest (expected: ByteBuf, FileRegion)
	at io.netty.channel.nio.AbstractNioByteChannel.filterOutboundMessage(AbstractNioByteChannel.java:286)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.write(AbstractChannel.java:878)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.write(DefaultChannelPipeline.java:1367)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702)
	at io.netty.handler.logging.LoggingHandler.write(LoggingHandler.java:279)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790)
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758)
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:808)
	at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025)
	at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:294)
	at reactor.netty.http.HttpOperations.lambda$then$2(HttpOperations.java:200)
	at reactor.netty.FutureMono$DeferredFutureMono.subscribe(FutureMono.java:114)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)
	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
	at reactor.netty.NettyOutbound.subscribe(NettyOutbound.java:336)
	at reactor.core.publisher.MonoSource.subscribe(MonoSource.java:65)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
	at reactor.netty.http.client.HttpClientConnect$HttpIOHandlerObserver.onStateChange(HttpClientConnect.java:446)
	at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:518)
	at reactor.netty.resources.PooledConnectionProvider$DisposableAcquire.onStateChange(PooledConnectionProvider.java:561)
	at reactor.netty.resources.PooledConnectionProvider$PooledConnection.onStateChange(PooledConnectionProvider.java:448)
	at reactor.netty.channel.ChannelOperationsHandler.channelActive(ChannelOperationsHandler.java:65)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:209)
	at io.netty.handler.logging.LoggingHandler.channelActive(LoggingHandler.java:189)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:209)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:305)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:335)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:707)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

Is there extra work that is required to enable this or should setting the protocol in the NettyServerCustomizer and the HttpClientCustomizer be enough?

@spencergibb
Copy link
Member Author

I don't know

@csterwa

This comment has been minimized.

@yhilem
Copy link

yhilem commented Apr 10, 2021

In my case the client supports HTTP/2 (https://github.com/IBM/cloudant-java-sdk) but the backend does not support HTTP/2 (apache/couchdb#1497).
The HTTP/1.1 backend service (couchdb) is exposed via Spring Cloud Gateway and the users/clients communicate with the backend service via HTTP/2 protocol through the Spring Cloud Gateway.
Is this configuration supported ?

@spencergibb
Copy link
Member Author

Terminating http 2 and switching to http 1.x is out of scope for this issue. Please open a new issue for us to consider.

@qqeasonchen

This comment has been minimized.

@aalansehaiyang
Copy link

hi,Does grpc routing and forwarding support? @spencergibb

@spencergibb spencergibb moved this from To do to In progress in 2021.0.0-M2 Sep 14, 2021
spencergibb added a commit that referenced this issue Sep 15, 2021
@spencergibb spencergibb added this to the 3.1.0-M2 milestone Sep 15, 2021
spencergibb added a commit that referenced this issue Sep 21, 2021
2021.0.0-M2 automation moved this from In progress to Done Sep 21, 2021
spencergibb added a commit that referenced this issue Sep 21, 2021
Adds HttpProtocol.H2 if server.http2.enabled=true.

Deprecates defaultConfigurationType as it is no longer used.

Updates to use new HttpClient ProtocolSslContextSpec for configuring ssl.

Fixes gh-7
Fixes gh-2206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2021.0.0-M2
  
Done
Development

Successfully merging a pull request may close this issue.