Comments (6)
@akshaysu Currently:
-
If one uses the global
LoopResources
/ConnectionProvider
, one can usereactor.netty.http.HttpResources#disposeLoopsAndConnections
when it is appropriate because it will dispose these resources for the server and all clients that are currently running. -
If one provides separate
LoopResources
/ConnectionProvider
, again one knows better when those can be disposed. Reactor Netty doesn't have the knowledge whetherLoopResources
/ConnectionProvider
are used only for the current server/client or they are shared amongst others.
Because of 1. and 2. there is no API for disposing LoopResources
/ConnectionProvider
on the level of server/client.
We can try to extend the documentation. Would you like to provide a PR with changes in the documentation?
from reactor-netty.
@violetagg thanks for the reply. Sorry, I'm new to the project reactor world. What do you mean by global LoopResources/ConnectionProvider? The one provided by the library when HttpClient.create() is called? Also, what happens when one uses ConnectionProivder.newConnection()? Do I need to dispose in this case?
from reactor-netty.
What do you mean by global LoopResources/ConnectionProvider? The one provided by the library when HttpClient.create() is called?
Yes HttpResources
is used when HttpServer/HttpClient#create()
is invoked.
Also, what happens when one uses ConnectionProivder.newConnection()
This is a ConnectionProvider
that closes the connection after every request i.e. if you want to disable the connection pooling.
from reactor-netty.
@violetagg If I create 2 httpclients using HttpClient.create()
are they going to share same LoopReosurces and ConnectionProviders? If I just provide ConnectionProvider like HttpClient.create(provider)
what is the behaviour? Are there any reference document I can dig into?
My question on ConnectionProvider.newConnection() is that does this share same resources with other httpclients? and do I need to dispose for newConnection also?
I'm using HttpClient in Database Handler for remote api call. When database is closed I need to release HttpClient also
from reactor-netty.
@violetagg If I create 2 httpclients using
HttpClient.create()
are they going to share same LoopReosurces and ConnectionProviders?
Yes
If I just provide ConnectionProvider like
HttpClient.create(provider)
what is the behaviour?
This particular HttpClient
will run with the provided ConnectionProvider
.
Are there any reference document I can dig into?
Check this
https://projectreactor.io/docs/netty/release/reference/index.html#_connection_pool_2
and this
https://projectreactor.io/docs/netty/release/reference/index.html#_event_loop_group_2
My question on ConnectionProvider.newConnection() is that does this share same resources with other httpclients? and do I need to dispose for newConnection also?
The connection created by this special ConnectionProvider
is never pooled and is closed after the request/response processing i.e. you do not use any connection pooling.
from reactor-netty.
@akshaysu I updated the reference documentation.
from reactor-netty.
Related Issues (20)
- Support For Spnego Auth scheme support for netty HttpClient similar to Apache's HOT 3
- HTTP/1.1 is being logged and recorded by metrics even though HTTP/2 is enabled HOT 10
- proxy-authorization header is not propagated to proxy server HOT 9
- Support for Spengo auth scheme support for netty HttpClient similar to Apache HttpClient HOT 2
- Spring Cloud Gateway use reactor netty :Response header and response body packet capture were found to be separate HOT 1
- CompletableFuture is cancelled because Netty is closing the connection channel HOT 5
- WebSockets - MaxFramePayloadLength behaviour when using WebSocketServerSpec.compress(true) HOT 2
- Timeout leaves connection in the pool in configured state, blocking a pool slot HOT 17
- ERROR io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() was not called before it's garbage-collected. HOT 3
- HTTP2 Client doesn't work/DefaultChannelPipeline wrongly configure for HTTP2 HOT 2
- Connection reset by peer; nested exception is io.netty.channel.unix.Errors$NativeIoException: readAddress(..) HOT 2
- springcloud gateway netty pool config HOT 1
- LEAK: ByteBuf.release() was not called before it's garbage-collected. HOT 17
- ClassNotFoundException for HttpDecoderConfig using reactor-netty-http HOT 3
- Mutable NewConnectionProvider HOT 10
- ByteBuf LEAK when PoolAcquirePendingLimitException is thrown HOT 9
- Consistent Memory Increase in Webflux Application HOT 5
- Build should not depend on `doc:antora`
- Ongoing connection reset by peer HOT 6
- Memory Leak in reactor-netty when using Spring WebClient with blocked flux. Issue: Databuffer is not released. HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactor-netty.