microsoftgraph / microsoftgraph/msgraph-sdk-java
Is GraphServiceClient threadsafe?
還沒有人認領這個 Issue。
- 主要語言
- Java
- 星號
- 444
- 分支
- 154
- 平均合併
- 18 小時 28 分鐘
- 30 天內合併 PR
- 4
描述
Hi,
I am using msgraph sdk to get 'User' details in an application. Initialized the GraphServiceClient for app-only authentication as specified in the tutorial: https://learn.microsoft.com/en-us/graph/tutorials/java-app-only?tabs=aad&tutorial-step=3.
I want to query the 'users' using certain filter and select criteria, e.g.
_appClient.users().get(requestConfig -> {
requestConfig.queryParameters.filter = "displayName startsWith \'A\'";
requestConfig.queryParameters.select = new String[] { "displayName", "id", "mail" };
requestConfig.queryParameters.top = 25;
requestConfig.queryParameters.orderby = new String[] { "displayName" };
});
However, this request may happen from the context of different threads.
My queries are:
- Does each thread need to instantiate GraphServiceClient separately, or, can we initialize once and share across threads?
- If _appClient (i.e the instance of GraphServiceClient) can be shared, is it thread-safe or do we need to synchronize access to it?
Any insight will be helpful.
The following artifact versions are used: microsoft-graph (v 6.20.0) and azure-identity (1.14.1).
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從連結的 Microsoft Graph Java app-only 教學課程,以及與 microsoft-graph 6.20.0 和 azure-identity 1.14.1 相關的 GraphServiceClient 用法開始。檢查 repository 文件和用戶端實作,以取得跨執行緒共用同一個執行個體的相關指引。完成的標準是明確記錄是否支援共用,以及呼叫端是否需要同步。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- api
- Issue 類型
- 文件
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 冷清
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100