Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit fd6bee9

Browse files
author
Tracy Boehrer
committed
Providing the bot-connector ExecutorService via DI in bot-integration-spring.
1 parent 08c76cf commit fd6bee9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

libraries/bot-integration-spring/src/main/java/com/microsoft/bot/integration/spring/BotDependencyConfiguration.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.microsoft.bot.builder.Storage;
99
import com.microsoft.bot.builder.UserState;
1010
import com.microsoft.bot.builder.inspection.InspectionState;
11+
import com.microsoft.bot.connector.ExecutorFactory;
1112
import com.microsoft.bot.connector.authentication.ChannelProvider;
1213
import com.microsoft.bot.connector.authentication.CredentialProvider;
1314
import com.microsoft.bot.integration.BotFrameworkHttpAdapter;
@@ -17,6 +18,8 @@
1718
import com.microsoft.bot.integration.ConfigurationCredentialProvider;
1819
import org.springframework.context.annotation.Bean;
1920

21+
import java.util.concurrent.ExecutorService;
22+
2023
/**
2124
* This provides the default dependency creation for a Bot application.
2225
*
@@ -27,6 +30,19 @@
2730
* constructor to use.</p>
2831
*/
2932
public abstract class BotDependencyConfiguration {
33+
/**
34+
* Returns an ExecutorService.
35+
*
36+
* <p>For now, return the bot-connector ExecutorService. This is an area of consideration. The
37+
* goal here is to have a common ExecutorService to avoid multiple thread pools.</p>
38+
*
39+
* @return An ExecutorService.
40+
*/
41+
@Bean
42+
public ExecutorService getExecutorService() {
43+
return ExecutorFactory.getExecutor();
44+
}
45+
3046
/**
3147
* Returns the Configuration for the application.
3248
*

0 commit comments

Comments
 (0)