Search code examples
javaspringcommunicationfile-transferspring-restcontroller

Java Spring Restcontroller Communication Message+File


I have a small task to design 2 applications application1: takes a file from a web interface that the user uploads. Further the user makes an input like book1 or book2 etc. Iv managed to put together a RestController in a Spring boot application that takes the input and the file. Iv also managed to put together application2: which does the processing of that file (convert it to a json file) and send it back to the application1 which the user can download(it is also a Spring boot application written in java like application1).

I have unfortunately no clue how to put together the communication between the two RestControllers. Could some1 point me in the right direction where i can read up on this?


Solution

  • You can use RestTemplate .

    RestTemplate is used to consume API in Spring Boot

    https://spring.io/guides/gs/consuming-rest/