Skip to content

Commit

Permalink
Made the application events thread properties configurable. (#47)
Browse files Browse the repository at this point in the history
* Increased the thread event count to 100.

* Updating README with brief commit details

* Made the application events thread properties configurable.

* Updating README with brief commit details

---------

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
sanopsmx and actions-user authored Oct 17, 2023
1 parent 1bc628f commit 52990ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ e5792d192c6d5f67786b663fb7ba2138d1f9d95c | Yugandharkumar | Create commits-prese
6513067b376bf0ec650c2a032839d19741e6497c | sanopsmx | Increased the thread event count to 100. | 2023-10-06


914acfd7367e2c14206990a4985eafc29b41f9ff | Sanjeev Thatiparthi | Increased the thread events count to 100 (#46) | 2023-10-06
4cc3b9f3ae3cf44d52337b95dfd7de776f298251 | sanopsmx | Made the application events thread properties configurable. | 2023-10-17
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.pf4j.PluginManager;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down Expand Up @@ -188,11 +189,14 @@ public ApplicationEventMulticaster applicationEventMulticaster(
}

@Bean
public ThreadPoolTaskExecutor applicationEventTaskExecutor() {
public ThreadPoolTaskExecutor applicationEventTaskExecutor(
@Value("${thread.application.event.namePrefix:events-}") String threadNamePrefix,
@Value("${thread.application.event.corePoolSize:20}") int corePoolSize,
@Value("${thread.application.event.maxPoolSize:20}") int maxPoolSize) {
ThreadPoolTaskExecutor threadPool = new ThreadPoolTaskExecutor();
threadPool.setThreadNamePrefix("events-");
threadPool.setCorePoolSize(100);
threadPool.setMaxPoolSize(100);
threadPool.setThreadNamePrefix(threadNamePrefix);
threadPool.setCorePoolSize(corePoolSize);
threadPool.setMaxPoolSize(maxPoolSize);
return threadPool;
}

Expand Down

0 comments on commit 52990ea

Please sign in to comment.