Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bookstore-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
bookstore-app
Commits
225eb286
Commit
225eb286
authored
Jun 15, 2020
by
Narendar Vakiti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added zipkin and sleuth
parent
3ff6cb57
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
2 deletions
+28
-2
README.md
README.md
+1
-0
pom.xml
pom.xml
+12
-0
BookstoreApplication.java
src/main/java/com/bookstore/BookstoreApplication.java
+9
-0
BookStoreController.java
...in/java/com/bookstore/controller/BookStoreController.java
+1
-0
application.yml
src/main/resources/application.yml
+5
-2
No files found.
README.md
View file @
225eb286
...
...
@@ -9,5 +9,6 @@ This springboot application is for call rest services from BookStore API (https:
3.
Used Feign Client
4.
Added Eureka Client
5.
Added to Zuul Proxy Server
6.
Added Zipkin and sleuth
pom.xml
View file @
225eb286
...
...
@@ -34,15 +34,27 @@
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-sleuth
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-ribbon
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-hystrix
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-sleuth-zipkin
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
...
...
src/main/java/com/bookstore/BookstoreApplication.java
View file @
225eb286
...
...
@@ -2,9 +2,12 @@ package com.bookstore;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.loadbalancer.LoadBalanced
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.netflix.hystrix.EnableHystrix
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.web.client.RestTemplate
;
@SpringBootApplication
@EnableHystrix
...
...
@@ -16,4 +19,10 @@ public class BookstoreApplication {
SpringApplication
.
run
(
BookstoreApplication
.
class
,
args
);
}
@Bean
@LoadBalanced
public
RestTemplate
getRestTemplate
(){
return
new
RestTemplate
();
}
}
src/main/java/com/bookstore/controller/BookStoreController.java
View file @
225eb286
...
...
@@ -103,6 +103,7 @@ public class BookStoreController {
try
{
responseEntity
=
bookFeignService
.
getBookDetails
();
response
=
responseEntity
.
getBody
();
logger
.
info
(
"Book details response :: "
+
response
);
}
catch
(
Exception
e
){
logger
.
error
(
"Exception while fetching book details :: "
+
e
.
getMessage
());
...
...
src/main/resources/application.yml
View file @
225eb286
...
...
@@ -4,7 +4,10 @@ spring:
eureka
:
client
:
registerWithEureka
:
true
fetchRegistry
:
true
serviceUrl
:
defaultZone
:
${EUREKA_URI:http://localhost:8761/eureka}
defaultZone
:
http://localhost:8761/eureka
instance
:
preferIpAddress
:
true
\ No newline at end of file
preferIpAddress
:
true
hostname
:
localhost
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment