diff --git a/backend/src/main/java/com/woowacourse/zzimkkong/service/SlackService.java b/backend/src/main/java/com/woowacourse/zzimkkong/service/SlackService.java index 8f3d23c52..5fe5e410c 100644 --- a/backend/src/main/java/com/woowacourse/zzimkkong/service/SlackService.java +++ b/backend/src/main/java/com/woowacourse/zzimkkong/service/SlackService.java @@ -4,10 +4,14 @@ import com.woowacourse.zzimkkong.dto.slack.SlackResponse; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.MediaType; +import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.reactive.function.client.WebClient; +import reactor.netty.http.client.HttpClient; +import reactor.netty.resources.ConnectionProvider; +import java.time.Duration; import java.util.Objects; @Service @@ -19,7 +23,14 @@ public class SlackService { public SlackService(@Value("${service.url}") final String titleLink, final WebClient webClient) { this.titleLink = titleLink; - slackWebClient = webClient; + ConnectionProvider provider = ConnectionProvider.builder("slack-pool") + .maxConnections(10) + .maxIdleTime(Duration.ofSeconds(2L)) + .maxLifeTime(Duration.ofSeconds(2L)) + .lifo() + .build(); + HttpClient httpClient = HttpClient.create(provider); + slackWebClient = webClient.mutate().clientConnector(new ReactorClientHttpConnector(httpClient)).build(); } public void sendCreateMessage(SlackResponse slackResponse) { @@ -39,10 +50,8 @@ public void sendDeleteMessage(SlackResponse slackResponse) { private void send(final Attachments attachments, final String slackUrl) { if (!Objects.isNull(slackUrl)) { - slackWebClient.mutate() - .baseUrl(slackUrl) - .build() - .post() + slackWebClient.post() + .uri(slackUrl) .contentType(MediaType.APPLICATION_JSON) .bodyValue(attachments.toString()) .retrieve() diff --git a/frontend/package.json b/frontend/package.json index f5da540e3..6282bb7af 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "zzimkkong-frontend", - "version": "2.1.1", + "version": "2.1.2", "main": "src/index.tsx", "license": "MIT", "homepage": "https://github.com/woowacourse-teams/2021-zzimkkong", diff --git a/frontend/src/components/Header/Header.tsx b/frontend/src/components/Header/Header.tsx index a6419825d..54bfc05be 100644 --- a/frontend/src/components/Header/Header.tsx +++ b/frontend/src/components/Header/Header.tsx @@ -57,9 +57,16 @@ const Header = ({ onClickLogin }: HeaderProps): JSX.Element => { {accessToken ? ( - - 로그아웃 - + <> + + 마이 페이지 + + + 로그아웃 + + ) : ( <>