├── README.md
├── .mvn
├── jvm.config
├── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
└── maven.config
├── spring-cloud-starter-stream-processor-aggregator
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── META-INF
│ │ │ │ ├── spring.provides
│ │ │ │ ├── spring.factories
│ │ │ │ ├── spring-configuration-metadata-whitelist.properties
│ │ │ │ └── dataflow-configuration-metadata-whitelist.properties
│ │ └── java
│ │ │ └── org
│ │ │ └── springframework
│ │ │ └── cloud
│ │ │ └── stream
│ │ │ └── app
│ │ │ └── aggregator
│ │ │ └── processor
│ │ │ ├── ClientCacheAutoConfiguration.java
│ │ │ ├── ExcludeStoresAutoConfigurationEnvironmentPostProcessor.java
│ │ │ ├── AggregatorProperties.java
│ │ │ ├── AggregatorProcessorConfiguration.java
│ │ │ └── MessageStoreConfiguration.java
│ └── test
│ │ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── stream
│ │ └── app
│ │ └── aggregator
│ │ └── processor
│ │ └── AggregatorProcessorTests.java
├── pom.xml
└── README.adoc
├── .gitignore
├── README.adoc
├── CODE_OF_CONDUCT.adoc
├── pom.xml
├── aggregator-app-dependencies
└── pom.xml
├── mvnw.cmd
├── mvnw
└── LICENSE
/README.md:
--------------------------------------------------------------------------------
1 | # aggregator is no longer actively maintained by VMware, Inc.
2 |
3 |
--------------------------------------------------------------------------------
/.mvn/jvm.config:
--------------------------------------------------------------------------------
1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/aggregator/main/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/maven.config:
--------------------------------------------------------------------------------
1 | -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring
2 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
2 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/resources/META-INF/spring.provides:
--------------------------------------------------------------------------------
1 | provides: spring-cloud-starter-stream-processor-aggregator
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | apps/
2 | *.iml
3 | *.ipr
4 | *.iws
5 | .classpath
6 | .DS_Store
7 | .idea
8 | .project
9 | .settings
10 | .checkstyle
11 | bin
12 | build
13 | nohup.out
14 | out
15 | target
16 |
--------------------------------------------------------------------------------
/README.adoc:
--------------------------------------------------------------------------------
1 | # aggregator
2 |
3 | To learn more about this application and the supported properties, please review the following link.
4 |
5 | include::spring-cloud-starter-stream-processor-aggregator/README.adoc[]
6 |
7 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.env.EnvironmentPostProcessor=\
2 | org.springframework.cloud.stream.app.aggregator.processor.ExcludeStoresAutoConfigurationEnvironmentPostProcessor
3 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/resources/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=\
2 | org.springframework.cloud.stream.app.aggregator.processor.AggregatorProperties,\
3 | org.springframework.boot.autoconfigure.mongo.MongoProperties,\
4 | org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoProperties,\
5 | org.springframework.boot.autoconfigure.data.redis.RedisProperties,\
6 | org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
7 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/resources/META-INF/dataflow-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=\
2 | org.springframework.cloud.stream.app.aggregator.processor.AggregatorProperties,\
3 | org.springframework.boot.autoconfigure.mongo.MongoProperties,\
4 | org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoProperties,\
5 | org.springframework.boot.autoconfigure.data.redis.RedisProperties,\
6 | org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
7 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/java/org/springframework/cloud/stream/app/aggregator/processor/ClientCacheAutoConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.stream.app.aggregator.processor;
18 |
19 | import org.apache.geode.cache.GemFireCache;
20 | import org.apache.geode.cache.client.ClientCache;
21 |
22 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
23 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
24 | import org.springframework.context.annotation.Configuration;
25 | import org.springframework.data.gemfire.client.ClientCacheFactoryBean;
26 | import org.springframework.data.gemfire.config.annotation.ClientCacheApplication;
27 | import org.springframework.data.gemfire.config.annotation.EnablePdx;
28 |
29 | /**
30 | * TODO
31 | *
32 | * This is the copy of {@code org.springframework.boot.data.geode.autoconfigure.ClientCacheAutoConfiguration}
33 | * until {@code geode-spring-boot-starter} is released.
34 | *
35 | * @author John Blum
36 | */
37 | @Configuration
38 | @ConditionalOnClass({ ClientCacheFactoryBean.class, ClientCache.class })
39 | @ConditionalOnMissingBean(GemFireCache.class)
40 | @ClientCacheApplication
41 | @EnablePdx
42 | public class ClientCacheAutoConfiguration {
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.adoc:
--------------------------------------------------------------------------------
1 | = Contributor Code of Conduct
2 |
3 | As contributors and maintainers of this project, and in the interest of fostering an open
4 | and welcoming community, we pledge to respect all people who contribute through reporting
5 | issues, posting feature requests, updating documentation, submitting pull requests or
6 | patches, and other activities.
7 |
8 | We are committed to making participation in this project a harassment-free experience for
9 | everyone, regardless of level of experience, gender, gender identity and expression,
10 | sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
11 | religion, or nationality.
12 |
13 | Examples of unacceptable behavior by participants include:
14 |
15 | * The use of sexualized language or imagery
16 | * Personal attacks
17 | * Trolling or insulting/derogatory comments
18 | * Public or private harassment
19 | * Publishing other's private information, such as physical or electronic addresses,
20 | without explicit permission
21 | * Other unethical or unprofessional conduct
22 |
23 | Project maintainers have the right and responsibility to remove, edit, or reject comments,
24 | commits, code, wiki edits, issues, and other contributions that are not aligned to this
25 | Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
26 | that they deem inappropriate, threatening, offensive, or harmful.
27 |
28 | By adopting this Code of Conduct, project maintainers commit themselves to fairly and
29 | consistently applying these principles to every aspect of managing this project. Project
30 | maintainers who do not follow or enforce the Code of Conduct may be permanently removed
31 | from the project team.
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an
34 | individual is representing the project or its community.
35 |
36 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
37 | contacting a project maintainer at spring-code-of-conduct@pivotal.io . All complaints will
38 | be reviewed and investigated and will result in a response that is deemed necessary and
39 | appropriate to the circumstances. Maintainers are obligated to maintain confidentiality
40 | with regard to the reporter of an incident.
41 |
42 | This Code of Conduct is adapted from the
43 | https://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at
44 | https://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/]
45 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/java/org/springframework/cloud/stream/app/aggregator/processor/ExcludeStoresAutoConfigurationEnvironmentPostProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2018 git pull -r origin master the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.stream.app.aggregator.processor;
18 |
19 | import java.util.Properties;
20 |
21 | import org.springframework.boot.SpringApplication;
22 | import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
23 | import org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration;
24 | import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
25 | import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
26 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
27 | import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
28 | import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
29 | import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration;
30 |
31 | //TODO import org.springframework.boot.data.geode.autoconfigure.ClientCacheAutoConfiguration;
32 |
33 | import org.springframework.boot.env.EnvironmentPostProcessor;
34 | import org.springframework.core.env.ConfigurableEnvironment;
35 | import org.springframework.core.env.MutablePropertySources;
36 | import org.springframework.core.env.PropertiesPropertySource;
37 |
38 | /**
39 | * An {@link EnvironmentPostProcessor} to add {@code spring.autoconfigure.exclude} property
40 | * since we can't use {@code application.properties} from the library perspective.
41 | *
42 | * @author Artem Bilan
43 | */
44 | public class ExcludeStoresAutoConfigurationEnvironmentPostProcessor implements EnvironmentPostProcessor {
45 |
46 | @Override
47 | public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
48 | MutablePropertySources propertySources = environment.getPropertySources();
49 | Properties properties = new Properties();
50 |
51 | properties.setProperty("spring.autoconfigure.exclude",
52 | DataSourceAutoConfiguration.class.getName() + ", " +
53 | DataSourceTransactionManagerAutoConfiguration.class.getName() + ", " +
54 | MongoAutoConfiguration.class.getName() + ", " +
55 | MongoDataAutoConfiguration.class.getName() + ", " +
56 | MongoRepositoriesAutoConfiguration.class.getName() + ", " +
57 | EmbeddedMongoAutoConfiguration.class.getName() + ", " +
58 | RedisAutoConfiguration.class.getName() + ", " +
59 | // TODO ClientCacheAutoConfiguration.class.getName() + ", " +
60 | RedisRepositoriesAutoConfiguration.class.getName());
61 |
62 | propertySources.addLast(
63 | new PropertiesPropertySource("aggregator.exclude.stores.auto-configuration", properties));
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/java/org/springframework/cloud/stream/app/aggregator/processor/AggregatorProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.stream.app.aggregator.processor;
18 |
19 | import org.springframework.boot.context.properties.ConfigurationProperties;
20 | import org.springframework.expression.Expression;
21 |
22 | /**
23 | * Configuration properties for the Aggregator application.
24 | *
25 | * @author Artem Bilan
26 | */
27 | @ConfigurationProperties(AggregatorProperties.PREFIX)
28 | public class AggregatorProperties {
29 |
30 | static final String PREFIX = "aggregator";
31 |
32 | /**
33 | * SpEL expression for correlation key. Default to correlationId header
34 | */
35 | private Expression correlation;
36 |
37 | /**
38 | * SpEL expression for release strategy. Default is based on the sequenceSize header
39 | */
40 | private Expression release;
41 |
42 | /**
43 | * SpEL expression for aggregation strategy. Default is collection of payloads
44 | */
45 | private Expression aggregation;
46 |
47 | /**
48 | * SpEL expression for timeout to expiring uncompleted groups
49 | */
50 | private Expression groupTimeout;
51 |
52 | /**
53 | * Message store type
54 | */
55 | private String messageStoreType = MessageStoreType.SIMPLE;
56 |
57 | /**
58 | * Persistence message store entity: table prefix in RDBMS, collection name in MongoDb, etc
59 | */
60 | private String messageStoreEntity;
61 |
62 | public Expression getCorrelation() {
63 | return this.correlation;
64 | }
65 |
66 | public void setCorrelation(Expression correlation) {
67 | this.correlation = correlation;
68 | }
69 |
70 | public Expression getRelease() {
71 | return this.release;
72 | }
73 |
74 | public void setRelease(Expression release) {
75 | this.release = release;
76 | }
77 |
78 | public Expression getAggregation() {
79 | return this.aggregation;
80 | }
81 |
82 | public void setAggregation(Expression aggregation) {
83 | this.aggregation = aggregation;
84 | }
85 |
86 | public Expression getGroupTimeout() {
87 | return this.groupTimeout;
88 | }
89 |
90 | public void setGroupTimeout(Expression groupTimeout) {
91 | this.groupTimeout = groupTimeout;
92 | }
93 |
94 | public String getMessageStoreEntity() {
95 | return this.messageStoreEntity;
96 | }
97 |
98 | public void setMessageStoreEntity(String messageStoreEntity) {
99 | this.messageStoreEntity = messageStoreEntity;
100 | }
101 |
102 | public String getMessageStoreType() {
103 | return this.messageStoreType;
104 | }
105 |
106 | public void setMessageStoreType(String messageStoreType) {
107 | this.messageStoreType = messageStoreType;
108 | }
109 |
110 | interface MessageStoreType {
111 |
112 | String SIMPLE = "simple";
113 |
114 | String JDBC = "jdbc";
115 |
116 | String MONGODB = "mongodb";
117 |
118 | String REDIS = "redis";
119 |
120 | String GEMFIRE = "gemfire";
121 |
122 | }
123 |
124 | }
125 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.springframework.cloud.stream.app
8 | app-starters-build
9 | 2.1.7.BUILD-SNAPSHOT
10 |
11 |
12 |
13 | aggregator-app-starters-build
14 | 2.1.6.BUILD-SNAPSHOT
15 | pom
16 |
17 |
18 | spring-cloud-starter-stream-processor-aggregator
19 | aggregator-app-dependencies
20 |
21 |
22 |
23 |
24 |
25 | org.springframework.cloud.stream.app
26 | aggregator-app-dependencies
27 | 2.1.6.BUILD-SNAPSHOT
28 | pom
29 | import
30 |
31 |
32 |
33 |
34 |
35 |
36 | spring
37 |
38 |
39 | spring-snapshots
40 | Spring Snapshots
41 | https://repo.spring.io/libs-snapshot-local
42 |
43 | true
44 |
45 |
46 |
47 | spring-milestones
48 | Spring Milestones
49 | https://repo.spring.io/libs-milestone-local
50 |
51 | false
52 |
53 |
54 |
55 | spring-releases
56 | Spring Releases
57 | https://repo.spring.io/release
58 |
59 | false
60 |
61 |
62 |
63 | spring-libs-release
64 | Spring Libs Release
65 | https://repo.spring.io/libs-release
66 |
67 | false
68 |
69 |
70 |
71 |
72 | false
73 |
74 | spring-milestone-release
75 | Spring Milestone Release
76 | https://repo.spring.io/libs-milestone
77 |
78 |
79 | gemstone-release-pivotal
80 | https://repo.spring.io/gemstone-release-pivotal
81 | Gemfire Release Repository
82 |
83 | false
84 |
85 |
86 |
87 |
88 |
89 | spring-releases>
90 | Spring Releases
91 | https://repo.spring.io/libs-release
92 |
93 |
94 | spring-snapshots
95 | Spring Snapshots
96 | https://repo.spring.io/libs-snapshot-local
97 |
98 | true
99 |
100 |
101 |
102 | spring-milestones
103 | Spring Milestones
104 | https://repo.spring.io/libs-milestone-local
105 |
106 | false
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/aggregator-app-dependencies/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | spring-cloud-dependencies-parent
9 | org.springframework.cloud
10 | 2.1.11.RELEASE
11 |
12 |
13 |
14 | org.springframework.cloud.stream.app
15 | aggregator-app-dependencies
16 | 2.1.6.BUILD-SNAPSHOT
17 | pom
18 | aggregator-app-dependencies
19 | Spring Cloud Stream Aggregator App Dependencies
20 |
21 |
22 |
23 | 2.13.3
24 |
25 |
26 |
27 |
28 |
29 | org.apache.logging.log4j
30 | log4j-to-slf4j
31 | ${log4j2.version}
32 | provided
33 |
34 |
35 |
36 |
37 | org.apache.logging.log4j
38 | log4j-core
39 | ${log4j2.version}
40 |
41 |
42 | org.apache.logging.log4j
43 | log4j-api
44 | ${log4j2.version}
45 |
46 |
47 |
48 | org.springframework.cloud.stream.app
49 | spring-cloud-starter-stream-processor-aggregator
50 | 2.1.6.BUILD-SNAPSHOT
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 | spring
65 |
66 |
67 | spring-snapshots
68 | Spring Snapshots
69 | https://repo.spring.io/libs-snapshot-local
70 |
71 | true
72 |
73 |
74 |
75 | spring-milestones
76 | Spring Milestones
77 | https://repo.spring.io/libs-milestone-local
78 |
79 | false
80 |
81 |
82 |
83 | spring-releases
84 | Spring Releases
85 | https://repo.spring.io/release
86 |
87 | false
88 |
89 |
90 |
91 | spring-libs-release
92 | Spring Libs Release
93 | https://repo.spring.io/libs-release
94 |
95 | false
96 |
97 |
98 |
99 |
100 | false
101 |
102 | spring-milestone-release
103 | Spring Milestone Release
104 | https://repo.spring.io/libs-milestone
105 |
106 |
107 |
108 |
109 | spring-snapshots
110 | Spring Snapshots
111 | https://repo.spring.io/libs-snapshot-local
112 |
113 | true
114 |
115 |
116 |
117 | spring-milestones
118 | Spring Milestones
119 | https://repo.spring.io/libs-milestone-local
120 |
121 | false
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | org.springframework.cloud.stream.app
9 | aggregator-app-starters-build
10 | 2.1.6.BUILD-SNAPSHOT
11 |
12 |
13 | spring-cloud-starter-stream-processor-aggregator
14 | jar
15 | spring-cloud-starter-stream-processor-aggregator
16 | Spring Cloud Stream Aggregator Processor Starter
17 |
18 |
19 |
20 |
21 | org.springframework.boot
22 | spring-boot-starter-logging
23 |
24 |
25 | org.apache.logging.log4j
26 | log4j-to-slf4j
27 |
28 |
29 |
30 |
31 |
32 | org.apache.logging.log4j
33 | log4j-core
34 |
35 |
36 | org.apache.logging.log4j
37 | log4j-api
38 |
39 |
40 |
41 | org.springframework.integration
42 | spring-integration-mongodb
43 |
44 |
45 | org.springframework.boot
46 | spring-boot-starter-data-mongodb
47 | runtime
48 |
49 |
50 | de.flapdoodle.embed
51 | de.flapdoodle.embed.mongo
52 | test
53 |
54 |
55 |
56 | org.springframework.integration
57 | spring-integration-redis
58 |
59 |
60 | org.springframework.boot
61 | spring-boot-starter-data-redis
62 | runtime
63 |
64 |
65 |
66 | org.springframework.integration
67 | spring-integration-gemfire
68 |
69 |
70 | org.springframework.data
71 | spring-data-gemfire
72 |
73 |
74 |
75 |
76 |
77 |
78 | org.springframework.data
79 | spring-data-geode
80 |
81 |
82 |
86 |
87 |
88 | org.springframework.integration
89 | spring-integration-jdbc
90 |
91 |
92 | org.springframework.boot
93 | spring-boot-starter-jdbc
94 | runtime
95 |
96 |
97 | org.hsqldb
98 | hsqldb
99 | runtime
100 |
101 |
102 | com.h2database
103 | h2
104 | runtime
105 |
106 |
107 | org.mariadb.jdbc
108 | mariadb-java-client
109 | runtime
110 |
111 |
112 | org.postgresql
113 | postgresql
114 | runtime
115 |
116 |
117 |
118 |
119 |
120 |
121 | org.springframework.cloud
122 | spring-cloud-app-starter-doc-maven-plugin
123 |
124 |
125 | org.springframework.cloud.stream.app.plugin
126 | spring-cloud-stream-app-maven-plugin
127 |
128 | ${session.executionRootDirectory}/apps
129 | ${project.version}
130 |
131 | scs-bom
132 | org.springframework.cloud.stream.app
133 | aggregator-app-dependencies
134 | ${project.version}
135 |
136 |
137 |
138 |
139 | true
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/java/org/springframework/cloud/stream/app/aggregator/processor/AggregatorProcessorConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.stream.app.aggregator.processor;
18 |
19 | import org.springframework.beans.factory.BeanFactory;
20 | import org.springframework.beans.factory.BeanFactoryAware;
21 | import org.springframework.beans.factory.ObjectProvider;
22 | import org.springframework.beans.factory.annotation.Autowired;
23 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
24 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
25 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
26 | import org.springframework.cloud.stream.annotation.EnableBinding;
27 | import org.springframework.cloud.stream.messaging.Processor;
28 | import org.springframework.context.annotation.Bean;
29 | import org.springframework.context.annotation.Configuration;
30 | import org.springframework.context.annotation.Import;
31 | import org.springframework.integration.aggregator.CorrelationStrategy;
32 | import org.springframework.integration.aggregator.DefaultAggregatingMessageGroupProcessor;
33 | import org.springframework.integration.aggregator.ExpressionEvaluatingCorrelationStrategy;
34 | import org.springframework.integration.aggregator.ExpressionEvaluatingMessageGroupProcessor;
35 | import org.springframework.integration.aggregator.ExpressionEvaluatingReleaseStrategy;
36 | import org.springframework.integration.aggregator.MessageGroupProcessor;
37 | import org.springframework.integration.aggregator.ReleaseStrategy;
38 | import org.springframework.integration.annotation.ServiceActivator;
39 | import org.springframework.integration.config.AggregatorFactoryBean;
40 | import org.springframework.integration.store.MessageGroupStore;
41 |
42 | /**
43 | * A Processor app that performs aggregation.
44 | *
45 | * @author Artem Bilan
46 | */
47 | @EnableBinding(Processor.class)
48 | @EnableConfigurationProperties(AggregatorProperties.class)
49 | public class AggregatorProcessorConfiguration {
50 |
51 | @Autowired
52 | private AggregatorProperties properties;
53 |
54 | @Autowired
55 | private BeanFactory beanFactory;
56 |
57 | @Bean
58 | @ServiceActivator(inputChannel = Processor.INPUT)
59 | public AggregatorFactoryBean aggregator(
60 | ObjectProvider correlationStrategy,
61 | ObjectProvider releaseStrategy,
62 | ObjectProvider messageGroupProcessor,
63 | ObjectProvider messageStore) {
64 | AggregatorFactoryBean aggregator = new AggregatorFactoryBean();
65 | aggregator.setOutputChannelName(Processor.OUTPUT);
66 | aggregator.setExpireGroupsUponCompletion(true);
67 | aggregator.setSendPartialResultOnExpiry(true);
68 | aggregator.setGroupTimeoutExpression(this.properties.getGroupTimeout());
69 |
70 | aggregator.setCorrelationStrategy(correlationStrategy.getIfAvailable());
71 | aggregator.setReleaseStrategy(releaseStrategy.getIfAvailable());
72 |
73 |
74 | MessageGroupProcessor groupProcessor = messageGroupProcessor.getIfAvailable();
75 |
76 | if (groupProcessor == null) {
77 | groupProcessor = new DefaultAggregatingMessageGroupProcessor();
78 | ((BeanFactoryAware) groupProcessor).setBeanFactory(this.beanFactory);
79 | }
80 | aggregator.setProcessorBean(groupProcessor);
81 |
82 | aggregator.setMessageStore(messageStore.getIfAvailable());
83 |
84 | return aggregator;
85 | }
86 |
87 | @Bean
88 | @ConditionalOnProperty(prefix = AggregatorProperties.PREFIX, name = "correlation")
89 | @ConditionalOnMissingBean
90 | public CorrelationStrategy correlationStrategy() {
91 | return new ExpressionEvaluatingCorrelationStrategy(this.properties.getCorrelation());
92 | }
93 |
94 | @Bean
95 | @ConditionalOnProperty(prefix = AggregatorProperties.PREFIX, name = "release")
96 | @ConditionalOnMissingBean
97 | public ReleaseStrategy releaseStrategy() {
98 | return new ExpressionEvaluatingReleaseStrategy(this.properties.getRelease());
99 | }
100 |
101 | @Bean
102 | @ConditionalOnProperty(prefix = AggregatorProperties.PREFIX, name = "aggregation")
103 | @ConditionalOnMissingBean
104 | public MessageGroupProcessor messageGroupProcessor() {
105 | return new ExpressionEvaluatingMessageGroupProcessor(this.properties.getAggregation().getExpressionString());
106 | }
107 |
108 |
109 | @Configuration
110 | @ConditionalOnMissingBean(MessageGroupStore.class)
111 | @Import({ MessageStoreConfiguration.Mongo.class, MessageStoreConfiguration.Redis.class,
112 | MessageStoreConfiguration.Gemfire.class, MessageStoreConfiguration.Jdbc.class })
113 | protected static class MessageStoreAutoConfiguration {
114 |
115 | }
116 |
117 | }
118 |
--------------------------------------------------------------------------------
/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven2 Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
40 |
41 | @REM set %HOME% to equivalent of $HOME
42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
43 |
44 | @REM Execute a user defined script before this one
45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
49 | :skipRcPre
50 |
51 | @setlocal
52 |
53 | set ERROR_CODE=0
54 |
55 | @REM To isolate internal variables from possible post scripts, we use another setlocal
56 | @setlocal
57 |
58 | @REM ==== START VALIDATION ====
59 | if not "%JAVA_HOME%" == "" goto OkJHome
60 |
61 | echo.
62 | echo Error: JAVA_HOME not found in your environment. >&2
63 | echo Please set the JAVA_HOME variable in your environment to match the >&2
64 | echo location of your Java installation. >&2
65 | echo.
66 | goto error
67 |
68 | :OkJHome
69 | if exist "%JAVA_HOME%\bin\java.exe" goto init
70 |
71 | echo.
72 | echo Error: JAVA_HOME is set to an invalid directory. >&2
73 | echo JAVA_HOME = "%JAVA_HOME%" >&2
74 | echo Please set the JAVA_HOME variable in your environment to match the >&2
75 | echo location of your Java installation. >&2
76 | echo.
77 | goto error
78 |
79 | @REM ==== END VALIDATION ====
80 |
81 | :init
82 |
83 | set MAVEN_CMD_LINE_ARGS=%*
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 |
121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar""
122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
123 |
124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
125 | if ERRORLEVEL 1 goto error
126 | goto end
127 |
128 | :error
129 | set ERROR_CODE=1
130 |
131 | :end
132 | @endlocal & set ERROR_CODE=%ERROR_CODE%
133 |
134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
138 | :skipRcPost
139 |
140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
142 |
143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
144 |
145 | exit /B %ERROR_CODE%
146 |
--------------------------------------------------------------------------------
/spring-cloud-starter-stream-processor-aggregator/src/main/java/org/springframework/cloud/stream/app/aggregator/processor/MessageStoreConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017-2018 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.stream.app.aggregator.processor;
18 |
19 | import java.util.Arrays;
20 |
21 | import org.apache.geode.cache.GemFireCache;
22 | import org.apache.geode.cache.Region;
23 |
24 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
25 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
26 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
27 | import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
28 | import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
29 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
30 | import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
31 | import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
32 | import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration;
33 | //import org.springframework.boot.data.geode.autoconfigure.ClientCacheAutoConfiguration;
34 | import org.springframework.context.annotation.Bean;
35 | import org.springframework.context.annotation.Import;
36 | import org.springframework.context.annotation.Primary;
37 | import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
38 | import org.springframework.data.mongodb.core.MongoTemplate;
39 | import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
40 | import org.springframework.data.redis.core.RedisTemplate;
41 | import org.springframework.integration.gemfire.store.GemfireMessageStore;
42 | import org.springframework.integration.jdbc.store.JdbcMessageStore;
43 | import org.springframework.integration.mongodb.store.ConfigurableMongoDbMessageStore;
44 | import org.springframework.integration.mongodb.support.BinaryToMessageConverter;
45 | import org.springframework.integration.mongodb.support.MessageToBinaryConverter;
46 | import org.springframework.integration.redis.store.RedisMessageStore;
47 | import org.springframework.integration.store.MessageGroupStore;
48 | import org.springframework.jdbc.core.JdbcTemplate;
49 | import org.springframework.util.StringUtils;
50 |
51 |
52 | /**
53 | * A helper class containing configuration classes for particular technologies
54 | * to expose an appropriate {@link org.springframework.integration.store.MessageStore} bean
55 | * via matched configuration properties.
56 | *
57 | * @author Artem Bilan
58 | */
59 | class MessageStoreConfiguration {
60 |
61 | @ConditionalOnClass(ConfigurableMongoDbMessageStore.class)
62 | @ConditionalOnProperty(prefix = AggregatorProperties.PREFIX,
63 | name = "message-store-type",
64 | havingValue = AggregatorProperties.MessageStoreType.MONGODB)
65 | @Import({ MongoAutoConfiguration.class,
66 | MongoDataAutoConfiguration.class,
67 | EmbeddedMongoAutoConfiguration.class })
68 | static class Mongo {
69 |
70 | @Bean
71 | public MessageGroupStore messageStore(MongoTemplate mongoTemplate, AggregatorProperties properties) {
72 | if (StringUtils.hasText(properties.getMessageStoreEntity())) {
73 | return new ConfigurableMongoDbMessageStore(mongoTemplate, properties.getMessageStoreEntity());
74 | }
75 | else {
76 | return new ConfigurableMongoDbMessageStore(mongoTemplate);
77 | }
78 | }
79 |
80 | @Bean
81 | @Primary
82 | public MongoCustomConversions mongoDbCustomConversions() {
83 | return new MongoCustomConversions(Arrays.asList(
84 | new MessageToBinaryConverter(), new BinaryToMessageConverter()));
85 | }
86 |
87 | }
88 |
89 | @ConditionalOnClass(RedisMessageStore.class)
90 | @ConditionalOnProperty(prefix = AggregatorProperties.PREFIX,
91 | name = "message-store-type",
92 | havingValue = AggregatorProperties.MessageStoreType.REDIS)
93 | @Import(RedisAutoConfiguration.class)
94 | static class Redis {
95 |
96 | @Bean
97 | public MessageGroupStore messageStore(RedisTemplate, ?> redisTemplate) {
98 | return new RedisMessageStore(redisTemplate.getConnectionFactory());
99 | }
100 |
101 | }
102 |
103 | @ConditionalOnClass(GemfireMessageStore.class)
104 | @ConditionalOnProperty(prefix = AggregatorProperties.PREFIX,
105 | name = "message-store-type",
106 | havingValue = AggregatorProperties.MessageStoreType.GEMFIRE)
107 | @Import(ClientCacheAutoConfiguration.class)
108 | static class Gemfire {
109 |
110 | @Bean
111 | @ConditionalOnMissingBean
112 | public ClientRegionFactoryBean, ?> gemfireRegion(GemFireCache cache, AggregatorProperties properties) {
113 | ClientRegionFactoryBean, ?> clientRegionFactoryBean = new ClientRegionFactoryBean<>();
114 | clientRegionFactoryBean.setCache(cache);
115 | clientRegionFactoryBean.setName(properties.getMessageStoreEntity());
116 | return clientRegionFactoryBean;
117 | }
118 |
119 | @Bean
120 | public MessageGroupStore messageStore(Region