-
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.
Showing
40 changed files
with
871 additions
and
361 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
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 { | ||
|
||
} |
18 changes: 12 additions & 6 deletions
18
src/backend/chatting-server/src/main/java/chattingserver/config/WebConfig.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,17 +1,23 @@ | ||
package chattingserver.config; | ||
|
||
import org.apache.catalina.filters.CorsFilter; | ||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.cors.CorsConfiguration; | ||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry | ||
.addMapping("/**") | ||
.allowedOrigins("*") | ||
registry.addMapping("/**") | ||
.allowedOriginPatterns("http://localhost:3000") | ||
.allowedMethods("*") | ||
.allowedHeaders("*") | ||
.allowCredentials(false) | ||
.maxAge(60000); | ||
.allowedHeaders("*"); | ||
} | ||
|
||
} |
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
Oops, something went wrong.