-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve Java DSL for Rabbit Streams #8598
Improve Java DSL for Rabbit Streams #8598
Conversation
* Expose simple properties for `streamName` and `superStream` on the `RabbitStreamInboundChannelAdapterSpec` * Add `superStream(String superStream, String name, int consumers)` option * Add `outboundStreamAdapter(Environment environment, String streamName)` factory for simple use-cases * Add `RabbitStreamTests` integration test to cover Rabbit Streams support and demonstrate respective Java DSL * Mention the change in the docs
ed23236
to
646213b
Compare
src/reference/asciidoc/amqp.adoc
Outdated
@@ -1426,7 +1426,7 @@ image::images/spring-integration-amqp-sample-graph.png[align="center"] | |||
|
|||
Version 6.0 introduced support for RabbitMQ Stream Queues. | |||
|
|||
The DSL factory class for these endpoints is `Rabbit`. | |||
The DSL factory class for these endpoints is a `RabbitStream`. |
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.
The DSL factory class for these endpoints is a `RabbitStream`. | |
The DSL factory class for these endpoints is `RabbitStream`. |
/** | ||
* Configure a name for Rabbit super stream to consume from. | ||
* @param superStream the name of Rabbit super stream. | ||
* @param consumerName the logical name to enable offset tracking. | ||
* @return the spec | ||
* @since 6.1 | ||
*/ | ||
public RabbitStreamInboundChannelAdapterSpec superName(String superStream, String consumerName) { | ||
return superName(superStream, consumerName, 1); | ||
} | ||
|
||
/** | ||
* Configure a name for Rabbit super stream to consume from. | ||
* @param superStream the name of Rabbit super stream. | ||
* @param consumerName the logical name to enable offset tracking. | ||
* @param consumers the number of consumers. | ||
* @return the spec | ||
* @since 6.1 | ||
*/ | ||
public RabbitStreamInboundChannelAdapterSpec superName(String superStream, String consumerName, int consumers) { |
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.
The docs say this is superStream
(which I think is better).
/** | |
* Configure a name for Rabbit super stream to consume from. | |
* @param superStream the name of Rabbit super stream. | |
* @param consumerName the logical name to enable offset tracking. | |
* @return the spec | |
* @since 6.1 | |
*/ | |
public RabbitStreamInboundChannelAdapterSpec superName(String superStream, String consumerName) { | |
return superName(superStream, consumerName, 1); | |
} | |
/** | |
* Configure a name for Rabbit super stream to consume from. | |
* @param superStream the name of Rabbit super stream. | |
* @param consumerName the logical name to enable offset tracking. | |
* @param consumers the number of consumers. | |
* @return the spec | |
* @since 6.1 | |
*/ | |
public RabbitStreamInboundChannelAdapterSpec superName(String superStream, String consumerName, int consumers) { | |
/** | |
* Configure a name for Rabbit super stream to consume from. | |
* @param superStream the name of Rabbit super stream. | |
* @param consumerName the logical name to enable offset tracking. | |
* @return the spec | |
* @since 6.1 | |
*/ | |
public RabbitStreamInboundChannelAdapterSpec superStream(String superStream, String consumerName) { | |
return superStream(superStream, consumerName, 1); | |
} | |
/** | |
* Configure a name for Rabbit super stream to consume from. | |
* @param superStream the name of Rabbit super stream. | |
* @param consumerName the logical name to enable offset tracking. | |
* @param consumers the number of consumers. | |
* @return the spec | |
* @since 6.1 | |
*/ | |
public RabbitStreamInboundChannelAdapterSpec superStream(String superStream, String consumerName, int consumers) { |
IntegrationFlow superStreamConsumer(Environment env) { | ||
return IntegrationFlow.from( | ||
RabbitStream.inboundAdapter(env) | ||
.superName("test.superStream1", "mySuperConsumer")) |
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.
.superName("test.superStream1", "mySuperConsumer")) | |
.superStream("test.superStream1", "mySuperConsumer")) |
streamName
andsuperStream
on theRabbitStreamInboundChannelAdapterSpec
superStream(String superStream, String name, int consumers)
optionoutboundStreamAdapter(Environment environment, String streamName)
factory for simple use-casesRabbitStreamTests
integration test to cover Rabbit Streams support and demonstrate respective Java DSL