microsoftgraph / microsoftgraph/msgraph-sdk-java
Is GraphServiceClient threadsafe?
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 444
- Forks
- 154
- Merge moyen
- 18 h 28 min
- PR mergées (30 j)
- 4
Description
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).
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le tutoriel Microsoft Graph Java app-only lié et par l’utilisation de GraphServiceClient pertinente pour microsoft-graph 6.20.0 et azure-identity 1.14.1. Consultez la documentation du dépôt et l’implémentation du client pour obtenir des indications sur le partage d’une même instance entre plusieurs threads. La tâche sera considérée comme terminée lorsqu’il sera clairement documenté si le partage est pris en charge et si les appelants doivent utiliser une synchronisation.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api
- Type d'issue
- Documentation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- Calme
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100