Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
c0903c5a
Commit
c0903c5a
authored
Nov 26, 2014
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pkg protected resetRoutes so new mappings can be created via post to /routes
parent
8e16789e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
RouteLocator.java
.../org/springframework/cloud/netflix/zuul/RouteLocator.java
+10
-3
ZuulHandlerMapping.java
...pringframework/cloud/netflix/zuul/ZuulHandlerMapping.java
+1
-1
application.yml
...-cloud-netflix-sidecar/src/test/resources/application.yml
+0
-6
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/RouteLocator.java
View file @
c0903c5a
...
...
@@ -45,7 +45,7 @@ public class RouteLocator implements ApplicationListener<EnvironmentChangeEvent>
public
void
onApplicationEvent
(
EnvironmentChangeEvent
event
)
{
for
(
String
key
:
event
.
getKeys
())
{
if
(
key
.
startsWith
(
properties
.
getMapping
()))
{
r
outes
.
set
(
locateRoutes
()
);
r
esetRoutes
(
);
return
;
}
}
...
...
@@ -53,13 +53,20 @@ public class RouteLocator implements ApplicationListener<EnvironmentChangeEvent>
public
Map
<
String
,
String
>
getRoutes
()
{
if
(
routes
.
get
()
==
null
)
{
r
outes
.
set
(
locateRoutes
()
);
r
eturn
resetRoutes
(
);
}
return
routes
.
get
();
}
protected
LinkedHashMap
<
String
,
String
>
locateRoutes
()
{
//access so ZuulHandlerMapping actuator can reset it's mappings
/*package*/
Map
<
String
,
String
>
resetRoutes
()
{
LinkedHashMap
<
String
,
String
>
newValue
=
locateRoutes
();
routes
.
set
(
newValue
);
return
newValue
;
}
protected
LinkedHashMap
<
String
,
String
>
locateRoutes
()
{
LinkedHashMap
<
String
,
String
>
routesMap
=
new
LinkedHashMap
<>();
// Add routes for discovery services by default
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/ZuulHandlerMapping.java
View file @
c0903c5a
...
...
@@ -74,7 +74,7 @@ public class ZuulHandlerMapping extends AbstractUrlHandlerMapping implements
@ResponseBody
@ManagedOperation
public
Map
<
String
,
String
>
reset
()
{
Map
<
String
,
String
>
routes
=
routeLocator
.
g
etRoutes
();
Map
<
String
,
String
>
routes
=
routeLocator
.
res
etRoutes
();
registerHandlers
(
routes
);
return
routes
;
}
...
...
spring-cloud-netflix-sidecar/src/test/resources/application.yml
View file @
c0903c5a
...
...
@@ -20,9 +20,3 @@ endpoints:
health
:
sensitive
:
false
zuul
:
proxy
:
route
:
stores
:
/stores
customers
:
/customers
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