-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Cloud Stream Reactor support. #572
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand why this particular dependency deserves to be added here. I've added a few comments to hopefully figure this out.
@@ -971,6 +971,17 @@ initializr: | |||
versionRange: 1.3.0.RELEASE | |||
groupId: org.springframework.cloud | |||
artifactId: spring-cloud-stream-binder-kafka | |||
- name: Stream Reactor | |||
id: cloud-stream-reactive | |||
description: Messaging microservices with Reactor. Typically used with a Spring Cloud Stream binder implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically used with a Spring Cloud Stream binder implementation.
What does that mean. Does this work standalone or does this require another dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it requires another dependency. You must choose a Spring Cloud Stream binder implementation like Kafka or RabbitMQ
- name: Stream Reactor | ||
id: cloud-stream-reactive | ||
description: Messaging microservices with Reactor. Typically used with a Spring Cloud Stream binder implementation. | ||
versionRange: 1.3.0.RELEASE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks fishy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. What's "fishy"?
- rel: reference | ||
href: https://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#_reactive_programming_support | ||
description: Reactive Programming support for Spring Cloud Stream | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like a reference to a sample that demonstrates what you can do with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here ya go. In a normal Spring Cloud Stream application I can say
@StreamListener("incomingMessageChannel")
public void incoming( Message<String> msg) {
// handle a new message
}
or:
@StreamListener("incomingMessageChannel")
public void incoming( String msg) {
// handle a new message
}
and messages will be delivered to the handler method from whatever message broker you've specified in choosing your Spring Cloud Stream binder. With the new support represented by this checkbox, we can have the incoming values delivered as a Reactor Flux<T>
. Your method is called once and all values are delivered as new values in the Flux<T>
stream. This makes it trivial to do things like windowing over values, and integrating with other reactive Publisher<T>
types (such as those that WebClient
produces).
Duplicate of #557 |
@joshlong we already discussed this entry in another issue you've created. |
import models only when they exist
Adds support for the reactor spring cloud stream binder.