Skip to content

Commit b117372

Browse files
authored
GH-2445: Doc Stream Provisioning and Dependency
Resolves #2445
1 parent 976b3df commit b117372

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/reference/asciidoc/stream.adoc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ Version 2.4 introduces initial support for the https://github.com/rabbitmq/rabbi
66
* `RabbitStreamTemplate`
77
* `StreamListenerContainer`
88

9+
Add the `spring-rabbit-stream` dependency to your project:
10+
11+
.maven
12+
====
13+
[source,xml,subs="+attributes"]
14+
----
15+
<dependency>
16+
<groupId>org.springframework.amqp</groupId>
17+
<artifactId>spring-rabbit-stream</artifactId>
18+
<version>{project-version}</version>
19+
</dependency>
20+
----
21+
====
22+
23+
.gradle
24+
====
25+
[source,groovy,subs="+attributes"]
26+
----
27+
compile 'org.springframework.amqp:spring-rabbit-stream:{project-version}'
28+
----
29+
====
30+
31+
Provision the queues as normal, using a `RabbitAdmin` bean, using the `QueueBuilder.stream()` method to designate the queue type.
32+
See <<stream-examples>>.
33+
934
==== Sending Messages
1035

1136
The `RabbitStreamTemplate` provides a subset of the `RabbitTemplate` (AMQP) functionality.
@@ -97,6 +122,7 @@ Refer to the https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmls
97122
When using `@RabbitListener`, configure a `StreamRabbitListenerContainerFactory`; at this time, most `@RabbitListener` properties (`concurrency`, etc) are ignored. Only `id`, `queues`, `autoStartup` and `containerFactory` are supported.
98123
In addition, `queues` can only contain one stream name.
99124

125+
[[stream-examples]]
100126
==== Examples
101127

102128
====
@@ -136,6 +162,20 @@ void nativeMsg(Message in, Context context) {
136162
...
137163
context.storeOffset();
138164
}
165+
166+
@Bean
167+
Queue stream() {
168+
return QueueBuilder.durable("test.stream.queue1")
169+
.stream()
170+
.build();
171+
}
172+
173+
@Bean
174+
Queue stream() {
175+
return QueueBuilder.durable("test.stream.queue2")
176+
.stream()
177+
.build();
178+
}
139179
----
140180
====
141181

0 commit comments

Comments
 (0)