Skip to content

Commit

Permalink
Restructure Cloud messaging
Browse files Browse the repository at this point in the history
This commit restructures the cloud messaging group by removing binder
specific checkbox for Spring Cloud Bus and Spring Cloud Stream. A new
"Messaging" group is added with RabbitMQ, Kafka and JMS.

To create a new cloud messaging project, the user should now select the
technology and a binder. To support Spring Cloud Stream with Kafka
streams, a dedicated "Kafka Streams" has been introduced.

Closes spring-iogh-557
  • Loading branch information
snicoll committed Feb 14, 2018
1 parent 65913e2 commit 6ced9ca
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
/**
* Determine the appropriate Spring Cloud stream dependency to use based on the
* selected messaging technology.
* <p>
* Does not replace the messaging technology jar by the relevant binder. If more than
* one tech is selected, it is far more easier to remove the unnecessary binder jar than
* to figure out the name of the tech jar to add to keep support for that technology.
*
* @author Stephane Nicoll
*/
Expand All @@ -50,7 +54,10 @@ public void postProcessAfterResolution(ProjectRequest request,
boolean hasReactiveSpringCloudStream = hasDependency(request,
"reactive-cloud-stream");
boolean hasSpringCloudBus = hasDependency(request, "cloud-bus");
if (hasSpringCloudStream || hasReactiveSpringCloudStream || hasSpringCloudBus) {
boolean hasSpringCloudTurbineStream = hasDependency(request,
"cloud-turbine-stream");
if (hasSpringCloudStream || hasReactiveSpringCloudStream || hasSpringCloudBus
|| hasSpringCloudTurbineStream) {
if (hasDependencies(request, "amqp")) {
request.getResolvedDependencies().add(RABBIT_BINDER);
}
Expand Down
11 changes: 6 additions & 5 deletions initializr-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ initializr:
- name: RabbitMQ
id: amqp
description: Advanced Message Queuing Protocol via spring-rabbit
weight: 100
keywords:
- stream
- messaging
links:
- rel: guide
Expand All @@ -745,7 +745,6 @@ initializr:
artifactId: spring-kafka
starter: false
keywords:
- stream
- messaging
links:
- rel: reference
Expand Down Expand Up @@ -806,7 +805,7 @@ initializr:
artifactId: spring-cloud-starter-oauth2
- name: Cloud Task
id: cloud-task
description: Task result tracking along with integration with batch and streams
description: Task result tracking and integration with Spring Batch
groupId: org.springframework.cloud
artifactId: spring-cloud-starter-task
versionRange: "1.3.0.RELEASE"
Expand Down Expand Up @@ -985,7 +984,7 @@ initializr:
- versionRange: "1.5.0.BUILD-SNAPSHOT"
- name: Turbine Stream
id: cloud-turbine-stream
description: Circuit breaker metric aggregation using spring-cloud-netflix with Turbine and Spring Cloud Stream (choose a specific Stream binder implementation to complement this)
description: Circuit breaker metric aggregation using spring-cloud-netflix with Turbine and Spring Cloud Stream (requires a binder, e.g. Kafka or RabbitMQ)
versionRange: 1.3.0.RELEASE
groupId: org.springframework.cloud
artifactId: spring-cloud-starter-netflix-turbine-stream
Expand Down Expand Up @@ -1041,12 +1040,14 @@ initializr:
id: cloud-stream
description: Messaging microservices with Spring Cloud Stream (requires a binder, e.g. Kafka or RabbitMQ)
versionRange: 1.3.0.RELEASE
weight: 90
groupId: org.springframework.cloud
artifactId: spring-cloud-stream
- name: Reactive Cloud Stream
id: reactive-cloud-stream
description: Reactive messaging microservices with Spring Cloud Stream (requires a binder, e.g. Kafka or RabbitMQ)
versionRange: 2.0.0.BUILD-SNAPSHOT
weight: 90
groupId: org.springframework.cloud
artifactId: spring-cloud-stream-reactive
- name: Cloud AWS
Expand Down Expand Up @@ -1213,7 +1214,7 @@ initializr:
- name: Kafka Streams
id: kafka-streams
weight: 90
description: Client library for building applications and microservices, where the input and output data are stored in Kafka clusters.
description: Support for building stream processing applications and microservices with Apache Kafka Streams (formerly known as KStream). Best used with Spring Cloud Stream.
versionRange: 1.5.0.RC1
groupId: org.apache.kafka
artifactId: kafka-streams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,45 @@ public void springCloudBusWithAllBinders() {
.hasSpringBootStarterTest()
.hasDependenciesCount(7);
}


@Test
public void springCloudTurbineStreamWithRabbit() {
ProjectRequest request = createProjectRequest("cloud-turbine-stream", "amqp");
request.setBootVersion("2.0.0.BUILD-SNAPSHOT");
generateMavenPom(request)
.hasDependency(getDependency("cloud-turbine-stream"))
.hasDependency(getDependency("amqp"))
.hasDependency(RABBIT_BINDER)
.hasSpringBootStarterTest()
.hasDependenciesCount(4);
}

@Test
public void springCloudTurbineStreamWithKafka() {
ProjectRequest request = createProjectRequest("cloud-turbine-stream", "kafka");
request.setBootVersion("2.0.0.BUILD-SNAPSHOT");
generateMavenPom(request)
.hasDependency(getDependency("cloud-turbine-stream"))
.hasDependency(getDependency("kafka"))
.hasDependency(KAFKA_BINDER)
.hasSpringBootStarterTest()
.hasDependenciesCount(4);
}

@Test
public void springCloudTurbineStreamWithAllBinders() {
ProjectRequest request = createProjectRequest("cloud-turbine-stream", "amqp",
"kafka", "kafka-streams");
request.setBootVersion("2.0.0.BUILD-SNAPSHOT");
generateMavenPom(request)
.hasDependency(getDependency("cloud-turbine-stream"))
.hasDependency(getDependency("amqp"))
.hasDependency(getDependency("kafka"))
.hasDependency(getDependency("kafka-streams"))
.hasDependency(RABBIT_BINDER)
.hasDependency(KAFKA_BINDER)
.hasSpringBootStarterTest()
.hasDependenciesCount(7);
}

}

0 comments on commit 6ced9ca

Please sign in to comment.