Add @PropertySources for default bus properties

This commit is contained in:
Dave Syer
2015-05-29 10:24:56 +01:00
parent c0a4b0bdd6
commit f671737f71
9 changed files with 33 additions and 57 deletions

View File

@@ -97,7 +97,7 @@ The best plan for making progress, where we keep in sight the goal of eventually
- [ ] We need the XML configuration from `/META-INF/spring-xd/bus/**` and `/META-INF/spring-xd/analytics` but
- [ ] There are no defaults for several properties in `xd.messagebus.*` so applications have to have a load of boilerplate configuration in `application.yml`
- [x] There are no defaults for several properties in `xd.messagebus.*` so applications have to have a load of boilerplate configuration in `application.yml`. Fixed by adding `@PropertySources` to the default configuration.
- [ ] The XML is in `spring-xd-dirt` which we don't want to depend on. Maybe it should be in the messagebus implementation jars?

View File

@@ -23,6 +23,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;
import org.springframework.xd.dirt.integration.rabbit.RabbitMessageBus;
/**
@@ -35,6 +36,7 @@ import org.springframework.xd.dirt.integration.rabbit.RabbitMessageBus;
@ConditionalOnClass(RabbitMessageBus.class)
@ImportResource({ "classpath*:/META-INF/spring-xd/bus/rabbit-bus.xml",
"classpath*:/META-INF/spring-xd/analytics/rabbit-analytics.xml" })
@PropertySource("classpath:/META-INF/spring-bus/rabbit-bus.properties")
public class RabbitServiceConfiguration {
@Configuration

View File

@@ -22,6 +22,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.xd.dirt.integration.redis.RedisMessageBus;
@@ -35,6 +36,7 @@ import org.springframework.xd.dirt.integration.redis.RedisMessageBus;
@ConditionalOnClass(RedisMessageBus.class)
@ImportResource({ "classpath*:/META-INF/spring-xd/bus/redis-bus.xml",
"classpath*:/META-INF/spring-xd/analytics/redis-analytics.xml" })
@PropertySource("classpath:/META-INF/spring-bus/redis-bus.properties")
public class RedisServiceConfiguration {
@Configuration

View File

@@ -0,0 +1,23 @@
xd.messagebus.rabbit.default.ackMode: AUTO
xd.messagebus.rabbit.default.autoBindDLQ: false
xd.messagebus.rabbit.default.backOffInitialInterval: 1000
xd.messagebus.rabbit.default.backOffMaxInterval: 10000
xd.messagebus.rabbit.default.backOffMultiplier: 2.0
xd.messagebus.rabbit.default.batchBufferLimit: 10000
xd.messagebus.rabbit.default.batchingEnabled: false
xd.messagebus.rabbit.default.batchSize: 100
xd.messagebus.rabbit.default.batchTimeout: 5000
xd.messagebus.rabbit.default.compress: false
xd.messagebus.rabbit.default.concurrency: 1
xd.messagebus.rabbit.default.deliveryMode: PERSISTENT
xd.messagebus.rabbit.default.durableSubscription: false
xd.messagebus.rabbit.default.maxAttempts: 3
xd.messagebus.rabbit.default.maxConcurrency: 1
xd.messagebus.rabbit.default.prefix: xdbus.
xd.messagebus.rabbit.default.prefetch: 1
xd.messagebus.rabbit.default.replyHeaderPatterns: STANDARD_REPLY_HEADERS,*
xd.messagebus.rabbit.default.republishToDLQ: false
xd.messagebus.rabbit.default.requestHeaderPatterns: STANDARD_REQUEST_HEADERS,*
xd.messagebus.rabbit.default.requeue: true
xd.messagebus.rabbit.default.transacted:false
xd.messagebus.rabbit.default.txSize: 1

View File

@@ -0,0 +1,5 @@
xd.messagebus.redis.default.backOffInitialInterval: 1000
xd.messagebus.redis.default.backOffMaxInterval: 10000
xd.messagebus.redis.default.backOffMultiplier: 2.0
xd.messagebus.redis.default.concurrency: 1
xd.messagebus.redis.default.maxAttempts: 3

View File

@@ -1,16 +1,2 @@
server:
port: 8081
---
xd:
messagebus:
redis:
headers:
# comma-delimited list of additional (string-valued) header names to transport
default:
# default bus properties, if not specified at the module level
backOffInitialInterval: 1000
backOffMaxInterval: 10000
backOffMultiplier: 2.0
concurrency: 1
maxAttempts: 3

View File

@@ -1,15 +1 @@
fixedDelay: 5
---
xd:
messagebus:
redis:
headers:
# comma-delimited list of additional (string-valued) header names to transport
default:
# default bus properties, if not specified at the module level
backOffInitialInterval: 1000
backOffMaxInterval: 10000
backOffMultiplier: 2.0
concurrency: 1
maxAttempts: 3

View File

@@ -1,15 +1 @@
fixedDelay: 5000
---
xd:
messagebus:
redis:
headers:
# comma-delimited list of additional (string-valued) header names to transport
default:
# default bus properties, if not specified at the module level
backOffInitialInterval: 1000
backOffMaxInterval: 10000
backOffMultiplier: 2.0
concurrency: 1
maxAttempts: 3

View File

@@ -1,16 +1,2 @@
server:
port: 8081
---
xd:
messagebus:
redis:
headers:
# comma-delimited list of additional (string-valued) header names to transport
default:
# default bus properties, if not specified at the module level
backOffInitialInterval: 1000
backOffMaxInterval: 10000
backOffMultiplier: 2.0
concurrency: 1
maxAttempts: 3