Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fileconsumer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
</exclusion>
</exclusions>
</dependency>
<!--lombok dependecy -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import lombok.extern.slf4j.Slf4j;

/**
* FileConsumer Application.
* FileConsumer Application main class.
*
* @author sombose
*
*/
@Slf4j
@SpringBootApplication
Expand All @@ -24,5 +23,4 @@ public static void main(String[] args) {
SpringApplication.run(FileConsumerAppApplication.class, args);
log.info("File Consumer App is started.");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package somesh.github.io.fileconsumer.app.shared;

import java.util.Arrays;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;

public interface CommonRestTemplate {

RestTemplate getrestTemplate();

default void restCall() {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
HttpEntity<String> entity = new HttpEntity<String>(headers);

getrestTemplate().exchange("http://localhost:8080/products", HttpMethod.GET, entity, String.class).getBody();
}
}