Hi  dragon-zhang

After I reviewed the code, I had a little doubt,

if used `HttpClient` , it be used by divide and spring cloud plugin,

and then used by websocket plugin, Is not as good as the original
isolation? (I can't confirm).

Looking forward to your reply.

thanks!

邪龙(dragon-zhang) <[email protected]> 于2022年4月11日周一 22:56写道:
>
> Hello community:
>
>
> This is a discussion on whether to reuse HttpClient 
> for&nbsp;WebSocketPluginConfiguration.
>
>
>
> current WebSocketPluginConfiguration:
>
>
> &nbsp; &nbsp; @Bean
> &nbsp; &nbsp; public ReactorNettyWebSocketClient 
> reactorNettyWebSocketClient(final ShenyuConfig shenyuConfig) {
> &nbsp; &nbsp; &nbsp; &nbsp; final ReactorNettyWebSocketClient webSocketClient 
> = new ReactorNettyWebSocketClient();
> &nbsp; &nbsp; &nbsp; &nbsp; 
> webSocketClient.setMaxFramePayloadLength(shenyuConfig.getWebsocket().getMaxFramePayloadSize()
>  * 1024 * 1024);
> &nbsp; &nbsp; &nbsp; &nbsp; return webSocketClient;
> &nbsp; &nbsp; }
>
>
> after reuse HttpClient in HttpClientPluginConfiguration:
>
>
> &nbsp; &nbsp; @Bean
> &nbsp; &nbsp; public ReactorNettyWebSocketClient 
> reactorNettyWebSocketClient(final ShenyuConfig shenyuConfig,
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
> &nbsp;final ObjectProvider<HttpClient&gt; httpClient) {
> &nbsp; &nbsp; &nbsp; &nbsp; final ReactorNettyWebSocketClient webSocketClient 
> = new 
> ReactorNettyWebSocketClient(httpClient.getIfAvailable(HttpClient::create));
> &nbsp; &nbsp; &nbsp; &nbsp; 
> webSocketClient.setMaxFramePayloadLength(shenyuConfig.getWebsocket().getMaxFramePayloadSize()
>  * 1024 * 1024);
> &nbsp; &nbsp; &nbsp; &nbsp; return webSocketClient;
> &nbsp; &nbsp; }
>
>
> I think reuse could be better, how do you guys feel ?
>
>
>
> Looking forward to your reply.
> dragon-zhang

Reply via email to