Skip to content

Commit 915df08

Browse files
Fix code snippet in change streams reference documentation.
Closes: #4376
1 parent 55c6f3b commit 915df08

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: src/main/asciidoc/reference/change-streams.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ The following example shows how to use Change Streams with `MessageListener` ins
2525
[source,java]
2626
----
2727
MessageListenerContainer container = new DefaultMessageListenerContainer(template);
28-
container.start(); <1>
28+
container.start(); <1>
2929
30-
MessageListener<ChangeStreamDocument<Document>, User> listener = System.out::println; <2>
31-
ChangeStreamRequestOptions options = new ChangeStreamRequestOptions("user", ChangeStreamOptions.empty()); <3>
30+
MessageListener<ChangeStreamDocument<Document>, User> listener = System.out::println; <2>
31+
ChangeStreamRequestOptions options = new ChangeStreamRequestOptions("db", "user", ChangeStreamOptions.empty()); <3>
3232
33-
Subscription subscription = container.register(new ChangeStreamRequest<>(listener, options), User.class); <4>
33+
Subscription subscription = container.register(new ChangeStreamRequest<>(listener, options), User.class); <4>
3434
3535
// ...
3636
37-
container.stop(); <5>
37+
container.stop(); <5>
3838
----
3939
<1> Starting the container initializes the resources and starts `Task` instances for already registered `SubscriptionRequest` instances. Requests added after startup are ran immediately.
4040
<2> Define the listener called when a `Message` is received. The `Message#getBody()` is converted to the requested domain type. Use `Document` to receive raw results without conversion.

0 commit comments

Comments
 (0)