I’m trying to retrieve data into a Service Bean from an extrernal microservice source .
But its giving a NullPointerException (Unsuccessful HTTP response in Cockpit).
I’m getting proper response in other Spring boot project though.
Below is my code :-
@Component(value=“cibil”)
public class cibil implements JavaDelegate {
private static final Logger LOGGER = LoggerFactory.getLogger(cibil.class);
@Override
public void execute(DelegateExecution execution) throws Exception {
try {
RestTemplate restTemplate = null;
String cibildemo = restTemplate.getForObject("https://jsonplaceholder.typicode.com/users", String.class);
execution.setVariable("cibildemo", cibildemo);
LOGGER.info( (String) execution.getVariable("cibildemo"));
}catch(Exception e) {
LOGGER.info("In Exception");
}
}
}
Does Camunda allow external API calls?