簡體   English   中英

默認的 Managed Executor Service 是否使用 Wildfly 中通用應用程序使用的相同線程池?

[英]Does the default Managed Executor Service use the same thread pool used by the general application in Wildfly?

我在 Wildfy 21 上部署的 JavaEE Web 應用程序中使用托管執行器服務。目標是在其他線程中執行長時間的定時任務,以釋放服務器使用的線程來響應客戶端的請求(HTTP 請求)。

我正在使用 Wildfly 中配置的默認執行程序服務:

@Resource(lookup = "java:jboss/ee/concurrency/executor/default")
public void setExecutorService(ManagedExecutorService executorService) {
    this.executorService = executorService;
}

默認托管執行器服務是否使用用於處理 HTTP 請求的同一線程池? 還是 Widfly 創建了一個新的線程池供 Managed Executor Service 使用?

我閱讀了 Widlfy 文檔,但沒有找到答案。

不,它沒有。

Managed Executor Service 使用的線程池與用於處理 HTTP 請求的線程池不同。

HTTP 請求由 Web (Undertow) 子系統處理,該子系統使用 Worker 中定義的線程。

暗流配置

另一方面,Managed Executor Service 有自己的線程配置

托管執行器服務配置

http://www.mastertheboss.com/jboss-web/jbosswebserver/using-a-custom-thread-pool-for-web-applications-running-on-wildfly

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM