diff --git a/roadmap.md b/roadmap.md index 5460008af..c17c0f6f5 100644 --- a/roadmap.md +++ b/roadmap.md @@ -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? diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RabbitServiceConfiguration.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RabbitServiceConfiguration.java index 3146acd67..26c72f4b2 100644 --- a/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RabbitServiceConfiguration.java +++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RabbitServiceConfiguration.java @@ -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 diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RedisServiceConfiguration.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RedisServiceConfiguration.java index 28328f7fe..dd1036282 100644 --- a/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RedisServiceConfiguration.java +++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/config/RedisServiceConfiguration.java @@ -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 diff --git a/spring-bus-core/src/main/resources/META-INF/spring-bus/rabbit-bus.properties b/spring-bus-core/src/main/resources/META-INF/spring-bus/rabbit-bus.properties new file mode 100644 index 000000000..9b05d0ba5 --- /dev/null +++ b/spring-bus-core/src/main/resources/META-INF/spring-bus/rabbit-bus.properties @@ -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 diff --git a/spring-bus-core/src/main/resources/META-INF/spring-bus/redis-bus.properties b/spring-bus-core/src/main/resources/META-INF/spring-bus/redis-bus.properties new file mode 100644 index 000000000..ed9fe4bbb --- /dev/null +++ b/spring-bus-core/src/main/resources/META-INF/spring-bus/redis-bus.properties @@ -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 diff --git a/spring-xd-samples/sink/src/main/resources/application.yml b/spring-xd-samples/sink/src/main/resources/application.yml index 17fd1f724..11e54c544 100644 --- a/spring-xd-samples/sink/src/main/resources/application.yml +++ b/spring-xd-samples/sink/src/main/resources/application.yml @@ -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 diff --git a/spring-xd-samples/source-xml/src/main/resources/application.yml b/spring-xd-samples/source-xml/src/main/resources/application.yml index a697962f0..9e1113c80 100644 --- a/spring-xd-samples/source-xml/src/main/resources/application.yml +++ b/spring-xd-samples/source-xml/src/main/resources/application.yml @@ -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 diff --git a/spring-xd-samples/source/src/main/resources/application.yml b/spring-xd-samples/source/src/main/resources/application.yml index 1d4d2eefe..daf5166e5 100644 --- a/spring-xd-samples/source/src/main/resources/application.yml +++ b/spring-xd-samples/source/src/main/resources/application.yml @@ -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 diff --git a/spring-xd-samples/tap/src/main/resources/application.yml b/spring-xd-samples/tap/src/main/resources/application.yml index 17fd1f724..11e54c544 100644 --- a/spring-xd-samples/tap/src/main/resources/application.yml +++ b/spring-xd-samples/tap/src/main/resources/application.yml @@ -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