Batch request for more than four steps with ms-graph #2103
Labels
duplicate
fixed
status:waiting-for-author-feedback
Issue that we've responded but needs author feedback to close
type:bug
A broken experience
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
The text was updated successfully, but these errors were encountered: