ScaleCube API Gateway is the single entry point for service consumers. handles incoming requests and proxy/route to the appropriate microservice instance.
Apache License 2.0
18
stars
7
forks
source link
Remove GatewayClientSettings, create more flexible configuration api #144
io.scalecube.services.gateway.transport.GatewayClientSettings becomes less and less flexible. It was expected to be generic settings class for any transport. But with time it becomes more clear that it was mistake to think in this direction, because it's impossible to have transport-agnostic configuration.
It's already clear that followRedirect is for http transport (so we leaked http to configuration => configration is not generic), keepAliveInterval is for websocket transport (so we leaked wesocket to configuration level => so configuration is not generic).
Plus new settings are comming: for http it has to be possible to specify custom ConnectionProvider (.newConnection() or .builder() for settings such as maxConnectionsmaxIdleTimemaxLifeTimependingAcquireTimeout)(io.scalecube.services.gateway.transport.http.HttpGatewayClient line 43), for websocket client must have ability to specify settings for reactor.netty.http.client.WebsocketClientSpec (because client very much might want to setup maxFramePayloadLengthprotocolsproxyPingcompress).
Expected updates
Remove of GatewayClientSettings.
Corresp. configration settings must start to live on corresp. transport client classes.
Motivation
io.scalecube.services.gateway.transport.GatewayClientSettings
becomes less and less flexible. It was expected to be generic settings class for any transport. But with time it becomes more clear that it was mistake to think in this direction, because it's impossible to have transport-agnostic configuration. It's already clear thatfollowRedirect
is for http transport (so we leaked http to configuration => configration is not generic),keepAliveInterval
is for websocket transport (so we leaked wesocket to configuration level => so configuration is not generic).Plus new settings are comming: for http it has to be possible to specify custom
ConnectionProvider
(.newConnection()
or.builder()
for settings such asmaxConnections
maxIdleTime
maxLifeTime
pendingAcquireTimeout
)(io.scalecube.services.gateway.transport.http.HttpGatewayClient
line 43), for websocket client must have ability to specify settings forreactor.netty.http.client.WebsocketClientSpec
(because client very much might want to setupmaxFramePayloadLength
protocols
proxyPing
compress
).Expected updates
GatewayClientSettings
.