brusdev commented on code in PR #6271:
URL: https://github.com/apache/artemis/pull/6271#discussion_r2879691923
##########
tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmxrbac/JmxRBACBrokerSecurityTest.java:
##########
@@ -322,23 +328,36 @@ private String getResponseBody(HttpResponse response) {
}
private void makeJolokiaRequest(String url, String jsonBody, String
username, String password, Consumer<HttpResponse> responseConsumer) throws
IOException {
- try (CloseableHttpClient httpClient =
HttpClientBuilder.create().build()) {
- HttpPost httpPost = new HttpPost(url);
-
- // Set authentication header
- String auth = username + ":" + password;
- String encodedAuth =
Base64.getEncoder().encodeToString(auth.getBytes(StandardCharsets.UTF_8));
- httpPost.setHeader("Authorization", "Basic " + encodedAuth);
-
- // Set required headers for jolokia
- httpPost.setHeader("Content-Type", "application/json");
- httpPost.setHeader("Origin", "http://localhost");
-
- // Set request body
- StringEntity entity = new StringEntity(jsonBody,
StandardCharsets.UTF_8);
- httpPost.setEntity(entity);
-
- responseConsumer.accept(httpClient.execute(httpPost));
+ final int retries = 30;
+ for (int i = 0; i < retries; i++) {
+ try (CloseableHttpClient httpClient =
HttpClientBuilder.create().build()) {
Review Comment:
Good fix. Thanks for fixing it!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]