microsoftgraph / microsoftgraph/msgraph-sdk-java
Is GraphServiceClient threadsafe?
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 444
- Fork
- 154
- Merge trung bình
- 18 giờ 28 phút
- Pull request đã merge (30 ngày)
- 4
Mô tả
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).
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với hướng dẫn Microsoft Graph Java app-only được liên kết và cách sử dụng GraphServiceClient liên quan đến microsoft-graph 6.20.0 và azure-identity 1.14.1. Kiểm tra tài liệu của repository và phần triển khai client để biết hướng dẫn về việc chia sẻ một instance giữa các thread. Được xem là hoàn thành khi đã ghi rõ liệu việc chia sẻ có được hỗ trợ hay không và liệu các caller có cần synchronization hay không.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api
- Loại issue
- Tài liệu
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100