I am calling a api which returns xm response , but that response has around 2GB data , could you please help how should we call that in efficient way , now its failing to databuffer limit exceeds
below is the XML dto class
@XmlRootElement(name = "Result")
@lombok.Data
@AllArgsConstructor
@NoArgsConstructor
public class Result{
private List<Data> dataLisst;
}
@XmlRootElement(name = "Data")
@lombok.Data
@AllArgsConstructor
@NoArgsConstructor
public class Data {
private Integer id;
private String dataVersion;
private String name;
}
Below is the way i am calling Webclient its mono object response
@Service
public class WebclientXML {
public Result getXMLResult() {
return getWebClient()
.get()
.uri("/xml-resp/res")
.retrieve()
.bodyToMono(Result.class)
.block();
}
private WebClient getWebClient() {
return WebClient.builder()
.baseUrl("http://<host>:port")
.build();
}
}