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
0a2d1703
Commit
0a2d1703
authored
Sep 25, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to new stream ChannelBindingServiceProperties
parent
befcada4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
24 deletions
+18
-24
HystrixStreamAutoConfiguration.java
...etflix/hystrix/stream/HystrixStreamAutoConfiguration.java
+9
-12
TurbineStreamAutoConfiguration.java
...etflix/turbine/stream/TurbineStreamAutoConfiguration.java
+9
-12
No files found.
spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamAutoConfiguration.java
View file @
0a2d1703
...
...
@@ -16,9 +16,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
hystrix
.
stream
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.annotation.PostConstruct
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,7 +23,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cloud.stream.annotation.EnableBinding
;
import
org.springframework.cloud.stream.config.ChannelBindingProperties
;
import
org.springframework.cloud.stream.config.BindingProperties
;
import
org.springframework.cloud.stream.config.ChannelBindingServiceProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
...
...
@@ -58,22 +56,21 @@ import com.netflix.hystrix.HystrixCircuitBreaker;
public
class
HystrixStreamAutoConfiguration
{
@Autowired
private
ChannelBindingProperties
bindings
;
private
ChannelBinding
Service
Properties
bindings
;
@Autowired
private
HystrixStreamProperties
properties
;
@PostConstruct
public
void
init
()
{
Object
outputBinding
=
this
.
bindings
.
getBindings
().
get
(
HystrixStreamClient
.
OUTPUT
);
if
(
outputBinding
==
null
||
outputBinding
instanceof
String
)
{
BindingProperties
outputBinding
=
this
.
bindings
.
getBindings
().
get
(
HystrixStreamClient
.
OUTPUT
);
if
(
outputBinding
==
null
)
{
this
.
bindings
.
getBindings
().
put
(
HystrixStreamClient
.
OUTPUT
,
new
HashMap
<
String
,
Object
>
());
new
BindingProperties
());
}
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
Object
>
output
=
(
Map
<
String
,
Object
>)
this
.
bindings
.
getBindings
().
get
(
HystrixStreamClient
.
OUTPUT
);
if
(!
output
.
containsKey
(
"destination"
)
||
HystrixStreamClient
.
OUTPUT
.
equals
(
outputBinding
))
{
output
.
put
(
"destination"
,
this
.
properties
.
getDestination
());
BindingProperties
output
=
this
.
bindings
.
getBindings
().
get
(
HystrixStreamClient
.
OUTPUT
);
if
(
output
.
getDestination
()
==
null
)
{
output
.
setDestination
(
this
.
properties
.
getDestination
());
}
}
...
...
spring-cloud-netflix-turbine-stream/src/main/java/org/springframework/cloud/netflix/turbine/stream/TurbineStreamAutoConfiguration.java
View file @
0a2d1703
...
...
@@ -16,16 +16,14 @@
package
org
.
springframework
.
cloud
.
netflix
.
turbine
.
stream
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.annotation.PostConstruct
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.cloud.stream.annotation.EnableBinding
;
import
org.springframework.cloud.stream.config.ChannelBindingProperties
;
import
org.springframework.cloud.stream.config.BindingProperties
;
import
org.springframework.cloud.stream.config.ChannelBindingServiceProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -54,22 +52,21 @@ import org.springframework.context.annotation.Configuration;
public
class
TurbineStreamAutoConfiguration
{
@Autowired
private
ChannelBindingProperties
bindings
;
private
ChannelBinding
Service
Properties
bindings
;
@Autowired
private
TurbineStreamProperties
properties
;
@PostConstruct
public
void
init
()
{
Object
inputBinding
=
this
.
bindings
.
getBindings
().
get
(
TurbineStreamClient
.
INPUT
);
if
(
inputBinding
==
null
||
inputBinding
instanceof
String
)
{
BindingProperties
inputBinding
=
this
.
bindings
.
getBindings
().
get
(
TurbineStreamClient
.
INPUT
);
if
(
inputBinding
==
null
)
{
this
.
bindings
.
getBindings
().
put
(
TurbineStreamClient
.
INPUT
,
new
HashMap
<
String
,
Object
>
());
new
BindingProperties
());
}
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
Object
>
input
=
(
Map
<
String
,
Object
>)
this
.
bindings
.
getBindings
().
get
(
TurbineStreamClient
.
INPUT
);
if
(!
input
.
containsKey
(
"destination"
)
||
TurbineStreamClient
.
INPUT
.
equals
(
inputBinding
))
{
input
.
put
(
"destination"
,
properties
.
getDestination
());
BindingProperties
input
=
this
.
bindings
.
getBindings
().
get
(
TurbineStreamClient
.
INPUT
);
if
(
input
.
getDestination
()
==
null
)
{
input
.
setDestination
(
properties
.
getDestination
());
}
}
...
...
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