i need to call service admin app to app with http. both the services is listening on port
c053b74b7e3a app-pre_prod:latest "java -jar -Dspring.…" 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp appPreProd
77d20ec0905c adminapp-pre_prod:latest "java -jar -Dspring.…" 0.0.0.0:8980->9080/tcp, :::9080->9080/tcp adminappPreProd
i am calling appPreProd from adminapppreprod with below code…
String tenantId = Long.toString(productUserMO.getId());
HttpHeaders headers = new HttpHeaders();
headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>();
map.add(Constants.X_TENANTID, tenantId);
HttpEntity<?> entity = new HttpEntity<Object>(map, headers);
restTemplate().exchange(apiURI.concat("/addPackageTypesForProductOwner"), HttpMethod.GET, entity,
String.class);
but getting error while making rest call
org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 : “Unauthorized access”
my services are not https enabled and also my api doesnot required any authorization and been exempted from that. also call is not reach appPreprod from adminpreprod, the issue is at calling service.. not sure what is missing in this code..
i tried changing the headers but that doesnt work either