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
cc2159f7
Commit
cc2159f7
authored
Mar 16, 2015
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use separate RabbitAdmin to declare queues and exchanges
Fixes gh-259
parent
9fe69cc8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
16 deletions
+11
-16
pom.xml
spring-cloud-netflix-hystrix-amqp/pom.xml
+0
-6
HystrixStreamAutoConfiguration.java
.../netflix/hystrix/amqp/HystrixStreamAutoConfiguration.java
+5
-1
pom.xml
spring-cloud-netflix-turbine-amqp/pom.xml
+0
-9
TurbineAmqpAutoConfiguration.java
...ud/netflix/turbine/amqp/TurbineAmqpAutoConfiguration.java
+6
-0
No files found.
spring-cloud-netflix-hystrix-amqp/pom.xml
View file @
cc2159f7
...
...
@@ -29,22 +29,16 @@
<artifactId>
spring-boot-starter-amqp
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-integration
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-netflix-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-amqp
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-java-dsl
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
...
...
spring-cloud-netflix-hystrix-amqp/src/main/java/org/springframework/cloud/netflix/hystrix/amqp/HystrixStreamAutoConfiguration.java
View file @
cc2159f7
...
...
@@ -18,6 +18,7 @@ package org.springframework.cloud.netflix.hystrix.amqp;
import
org.springframework.amqp.core.DirectExchange
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.rabbit.core.RabbitAdmin
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.amqp.support.converter.Jackson2JsonMessageConverter
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -111,7 +112,7 @@ public class HystrixStreamAutoConfiguration {
// TODO: set content type
/*
* .enrichHeaders(new ComponentConfigurer<HeaderEnricherSpec>() {
*
*
* @Override public void configure(HeaderEnricherSpec spec) {
* spec.header("content-type", "application/json", true); } })
*/
...
...
@@ -121,6 +122,9 @@ public class HystrixStreamAutoConfiguration {
private
ConnectionFactory
connectionFactory
()
{
if
(
this
.
hystrixConnectionFactory
!=
null
)
{
RabbitAdmin
amqpAdmin
=
new
RabbitAdmin
(
this
.
hystrixConnectionFactory
);
hystrixStreamExchange
().
setAdminsThatShouldDeclare
(
amqpAdmin
);
amqpAdmin
.
afterPropertiesSet
();
return
this
.
hystrixConnectionFactory
;
}
return
this
.
primaryConnectionFactory
;
...
...
spring-cloud-netflix-turbine-amqp/pom.xml
View file @
cc2159f7
...
...
@@ -63,33 +63,24 @@
<artifactId>
spring-boot-starter-amqp
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-integration
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-amqp
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-java-dsl
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.netflix.turbine
</groupId>
<artifactId>
turbine-core
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
io.reactivex
</groupId>
<artifactId>
rxjava
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
...
...
spring-cloud-netflix-turbine-amqp/src/main/java/org/springframework/cloud/netflix/turbine/amqp/TurbineAmqpAutoConfiguration.java
View file @
cc2159f7
...
...
@@ -25,6 +25,7 @@ import org.springframework.amqp.core.BindingBuilder;
import
org.springframework.amqp.core.DirectExchange
;
import
org.springframework.amqp.core.Queue
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.rabbit.core.RabbitAdmin
;
import
org.springframework.amqp.support.converter.Jackson2JsonMessageConverter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
...
...
@@ -105,6 +106,11 @@ public class TurbineAmqpAutoConfiguration {
private
ConnectionFactory
connectionFactory
()
{
if
(
this
.
turbineConnectionFactory
!=
null
)
{
RabbitAdmin
amqpAdmin
=
new
RabbitAdmin
(
this
.
turbineConnectionFactory
);
hystrixStreamExchange
().
setAdminsThatShouldDeclare
(
amqpAdmin
);
localTurbineAmqpQueueBinding
().
setAdminsThatShouldDeclare
(
amqpAdmin
);
hystrixStreamQueue
().
setAdminsThatShouldDeclare
(
amqpAdmin
);
amqpAdmin
.
afterPropertiesSet
();
return
this
.
turbineConnectionFactory
;
}
return
this
.
primaryConnectionFactory
;
...
...
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