Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch request for more than four steps with ms-graph #2103

Closed
dewijant opened this issue Aug 1, 2024 · 2 comments
Closed

Batch request for more than four steps with ms-graph #2103

dewijant opened this issue Aug 1, 2024 · 2 comments
Labels
duplicate fixed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience

Comments

@dewijant
Copy link

dewijant commented Aug 1, 2024

Describe the bug

I am trying send batch request with some simple GET request steps to Azure AD.
I can send only four steps in batch request, when I try five (and more) application gets stuck without any information in application log.

When I try send same request directly with REST API via postman, no problem. With Postman I can send maximum 20 steps in one batch request withou problem (I get response).

Why can I send only four steps with ms-graph API in java and via REST twenty is ok?

Expected behavior

Get response like from postman via REST API

How to reproduce

private void getEmployeesByInBatch(Map<Integer, String> valuesByEmployeeId, String attributeName) throws IOException { var batchGetUsersContent = new BatchRequestContent(this.client); Map<Integer, String> requestIdByEmployeeId = new HashMap<>(); valuesByEmployeeId.keySet().forEach(employeeId -> { var userInformation = findUserByEmployIdInfo(employeeId); requestIdByEmployeeId.put(employeeId, batchGetUsersContent.addBatchRequestStep(userInformation)); }); var response = this.client.getBatchRequestBuilder().post(batchGetUsersContent, null); Map<Integer, String> idByEmployeeId = new HashMap<>(); requestIdByEmployeeId.forEach((employeeId, requestId) -> { var userResponses = Optional.ofNullable(response.getResponseById(requestId, UserCollectionResponse::createFromDiscriminatorValue)); var user = userResponses.map(UserCollectionResponse::getValue) .filter(users -> !users.isEmpty()) .map(users -> users.get(0)); user.ifPresent(u -> idByEmployeeId.put(employeeId, u.getId())); }); System.out.println(idByEmployeeId); } private RequestInformation findUserByEmployIdInfo(Integer employeeId) { return this.client.users() .toGetRequestInformation(getRequestConfiguration -> { Objects.requireNonNull(getRequestConfiguration.queryParameters); getRequestConfiguration.queryParameters.select = new String[]{"id, onPremisesExtensionAttributes, displayName"}; getRequestConfiguration.queryParameters.filter = String.format("employeeId eq '%d'", employeeId); }); }

SDK Version

6.13.0

Latest version known to work for scenario above?

6.13.0

Known Workarounds

No response

Debug output

Click to expand log ``` No debug info, no error is displayed ```

Configuration

Windows 11, x64, Java 17

Other information

No response

@dewijant dewijant added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Aug 1, 2024
@dewijant dewijant changed the title Batch request Batch request for more than four steps with ms-graph Aug 1, 2024
@baywet
Copy link
Member

baywet commented Aug 1, 2024

Hi @dewijant ,
Thank you for using the SDK and for reaching out.
This bug has already been reported by the community and a fix has been released yesterday to address it.
Please make sure you update the core dependency to its latest version.
And let us know if you have any further questions.
microsoftgraph/msgraph-sdk-java-core#1687

@baywet baywet added duplicate fixed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Aug 1, 2024
Copy link
Contributor

This issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate fixed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants