-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/#70' of https://github.com/sgdevcamp2023/sgwannabe …
…into feat/#63
- Loading branch information
Showing
19 changed files
with
204 additions
and
70 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
29 changes: 29 additions & 0 deletions
29
src/backend/chatting-server/src/main/java/chattingserver/config/AsyncConfig.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,29 @@ | ||
package chattingserver.config; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableAsync; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
||
import java.util.concurrent.Executor; | ||
|
||
@Slf4j | ||
@EnableAsync | ||
@Configuration | ||
public class AsyncConfig { | ||
|
||
@Bean(name = "search") | ||
public Executor pushAsyncExecutor() { | ||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
int processors = Runtime.getRuntime().availableProcessors(); | ||
log.info("processors count {}", processors); | ||
executor.setThreadNamePrefix("SearchAsync- "); | ||
executor.setCorePoolSize(processors); | ||
executor.setMaxPoolSize(processors * 2); | ||
executor.setQueueCapacity(50); | ||
executor.setKeepAliveSeconds(60); | ||
executor.initialize(); | ||
return executor; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/backend/chatting-server/src/main/java/chattingserver/config/OpenFeignConfig.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,10 @@ | ||
package chattingserver.config; | ||
|
||
import org.springframework.cloud.openfeign.EnableFeignClients; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@EnableFeignClients(basePackages = {"chattingserver.controller"}) | ||
public class OpenFeignConfig { | ||
|
||
} |
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
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
12 changes: 12 additions & 0 deletions
12
src/backend/chatting-server/src/main/java/chattingserver/controller/SearchProxy.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,12 @@ | ||
package chattingserver.controller; | ||
|
||
import chattingserver.dto.request.IndexingRequestMessageDto; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
|
||
@FeignClient(name = "search-service", url = "localhost:20000") | ||
public interface SearchProxy { | ||
@PostMapping("/search/index/send") | ||
void sendIndexingRequest(@RequestBody IndexingRequestMessageDto dto); | ||
} |
16 changes: 16 additions & 0 deletions
16
...d/chatting-server/src/main/java/chattingserver/dto/request/IndexingRequestMessageDto.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,16 @@ | ||
package chattingserver.dto.request; | ||
|
||
import lombok.*; | ||
|
||
|
||
@ToString | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
@Builder | ||
public class IndexingRequestMessageDto { | ||
private String roomId; | ||
private String roomName; | ||
private String playlistId; | ||
private String thumbnailImage; | ||
} |
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
3 changes: 3 additions & 0 deletions
3
...backend/chatting-server/src/main/java/chattingserver/repository/RoomRepositoryCustom.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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package chattingserver.repository; | ||
|
||
import chattingserver.domain.room.User; | ||
import chattingserver.dto.request.ReadMessageUpdateRequestDto; | ||
import com.mongodb.client.result.UpdateResult; | ||
|
||
public interface RoomRepositoryCustom { | ||
|
||
void exitRoom(String roomId, Long uid); | ||
UpdateResult addUserToRoom(String roomId, User user); | ||
|
||
UpdateResult updateLastReadMsgId(ReadMessageUpdateRequestDto requestDto); | ||
} |
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
Oops, something went wrong.