-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from tukcomCD2024/backend/feature/91-add-locat…
…ion-coordinate [Backend : Feat] 비동기 처리를 통한 GPT 응답 시간 단축
- Loading branch information
Showing
6 changed files
with
120 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
backend/src/main/java/com/isp/backend/domain/gpt/config/WebClientConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.isp.backend.domain.gpt.config; | ||
|
||
import io.netty.channel.ChannelOption; | ||
import io.netty.handler.timeout.ReadTimeoutHandler; | ||
import io.netty.handler.timeout.WriteTimeoutHandler; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.client.reactive.ReactorClientHttpConnector; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
import reactor.netty.http.client.HttpClient; | ||
|
||
|
||
@Configuration | ||
public class WebClientConfig { | ||
@Bean | ||
public WebClient webClient() { | ||
HttpClient httpClient = HttpClient.create() | ||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 30000) | ||
.doOnConnected(conn -> conn | ||
.addHandlerLast(new ReadTimeoutHandler(10)) | ||
.addHandlerLast(new WriteTimeoutHandler(10))); | ||
return WebClient.builder() | ||
.clientConnector(new ReactorClientHttpConnector(httpClient)) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters