Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈文顺
discovery
Commits
b4679b05
Commit
b4679b05
authored
May 30, 2019
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加Hystrix逻辑
parent
8292f190
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/ARestImpl.java
+6
-0
discovery-springcloud-example-zuul/src/main/resources/application.properties
+3
-2
discovery-springcloud-example-zuul/src/main/resources/bootstrap.properties
+0
-2
No files found.
discovery-springcloud-example-service/src/main/java/com/nepxion/discovery/plugin/example/service/rest/ARestImpl.java
View file @
b4679b05
...
@@ -73,6 +73,12 @@ public class ARestImpl extends AbstractRestImpl {
...
@@ -73,6 +73,12 @@ public class ARestImpl extends AbstractRestImpl {
@RequestMapping
(
path
=
"/test"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
path
=
"/test"
,
method
=
RequestMethod
.
POST
)
public
String
test
(
@RequestBody
String
value
)
{
public
String
test
(
@RequestBody
String
value
)
{
try
{
Thread
.
sleep
(
5000
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
value
;
return
value
;
}
}
...
...
discovery-springcloud-example-zuul/src/main/resources/application.properties
View file @
b4679b05
...
@@ -22,4 +22,5 @@ management.server.port=5400
...
@@ -22,4 +22,5 @@ management.server.port=5400
# Zuul config
# Zuul config
zuul.routes.discovery-springcloud-example-a.path
=
/discovery-springcloud-example-a/**
zuul.routes.discovery-springcloud-example-a.path
=
/discovery-springcloud-example-a/**
zuul.routes.discovery-springcloud-example-a.serviceId
=
discovery-springcloud-example-a
zuul.routes.discovery-springcloud-example-a.serviceId
=
discovery-springcloud-example-a
\ No newline at end of file
#
zuul.ribbon-isolation-strategy
=
thread
\ No newline at end of file
discovery-springcloud-example-zuul/src/main/resources/bootstrap.properties
View file @
b4679b05
...
@@ -76,5 +76,4 @@ spring.boot.admin.client.url=http://localhost:5555
...
@@ -76,5 +76,4 @@ spring.boot.admin.client.url=http://localhost:5555
# 路由策略过滤器的执行顺序(Order)。缺失则默认为0
# 路由策略过滤器的执行顺序(Order)。缺失则默认为0
# spring.application.strategy.zuul.route.filter.order=0
# spring.application.strategy.zuul.route.filter.order=0
# 开启Zuul网关上实现Hystrix线程隔离模式做服务隔离时,必须把spring.application.strategy.hystrix.threadlocal.supported设置为true,同时要引入discovery-plugin-strategy-starter-hystrix包,否则线程切换时会发生ThreadLocal上下文对象丢失
# 开启Zuul网关上实现Hystrix线程隔离模式做服务隔离时,必须把spring.application.strategy.hystrix.threadlocal.supported设置为true,同时要引入discovery-plugin-strategy-starter-hystrix包,否则线程切换时会发生ThreadLocal上下文对象丢失
# zuul.ribbon-isolation-strategy=thread
#
spring.application.strategy.hystrix.threadlocal.supported
=
true
#
spring.application.strategy.hystrix.threadlocal.supported
=
true
\ 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