Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Is GraphServiceClient threadsafe?

Đang mở
#2,224 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
api

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.

Mô tả

Status: Needs Investigation

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).

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoftgraph/msgraph-sdk-java

Tất cả issue của microsoftgraph/msgraph-sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.