The @Bulkhead policy
The @Bulkhead annotation can also be applied to a class or method to enforce the bulkhead policy. This pattern isolates failures in the current operation to preserve the execution of other operations. The implementation does this by limiting the number of concurrent invocations on a given method:
@Bulkhead(4)
public void bulkheadedOperation() {
...
}
In the previous code, this method only supports four invocations at the same time. Should more than four simultaneous requests come into the bulkheadedOperation method, the system will hold the fifth and later requests until one of the four active invocations completes. The bulkhead annotation can also be used with @Asynchronous to limit the thread number in an asynchronous operation.
推薦閱讀
- 計算機網絡與通信(第2版)
- Modern JavaScript Web Development Cookbook
- Application Development with Qt Creator(Second Edition)
- 社交電商運營策略、技巧與實操
- OpenLayers Cookbook
- 物聯網概論(第2版)
- 面向云平臺的物聯網多源異構信息融合方法
- 6G新技術 新網絡 新通信
- 計算機網絡技術及應用
- 端到端QoS網絡設計
- 語音信號處理及Blackfin DSP實現
- 從實踐中學習手機抓包與數據分析
- 異構蜂窩網絡關鍵理論與技術
- Web用戶查詢日志挖掘與應用
- Hands-On Docker for Microservices with Python