0

I am new to microservices and stuck somewhere. Suppose my microservice M1 is getting some response from another microservice M2 using Rest Template. and whenever I hit the URL of M1 in postman it works fine if M2 is also working well as M2 is giving perfect Response. and If some exception happened at M2 then That exception get reflected into Postman response but I want to handle this and I want that the exception I handled at M1 should reflet in response. Like i want user detail from restTemplate from M2 and i entered the wrong ID and i want this not to affect my M1. I am getting a response inside a response which i dont want like

HttpClientErrorException$NotFound: 404 : "{"timestamp":"2023-02-14T17:14:18.343+00:00","status":404,"error":"Not Found","message":"Customer with given Id 900 is not found","path":"/customer/900"}"] with root cause

0 Answers0