Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/reference/antora/modules/ROOT/pages/stream.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,24 @@ You must add a `superStreamRoutingFunction` to the `RabbitStreamTemplate`:
RabbitStreamTemplate streamTemplate(Environment env) {
RabbitStreamTemplate template = new RabbitStreamTemplate(env, "stream.queue1");
template.setSuperStreamRouting(message -> {
// some logic to return a String for the client's hashing algorithm
// some logic to return a String for the client's routing hashing algorithm
return message.getApplicationProperties().get("ROUTING_KEY").toString();
});
return template;
}
----

The following is an example of sending a message using a RabbitStreamTemplate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RabbitStreamTemplate must be as a conde snippet.
Similar to the RabbitTemplate below.
Also, please, consider to add a colon in the end of this sentence since you are pointing to the sample next to it.


[source, java]
----
//Send a message with the routing property for the hashing algorithm
rabbitStreamTemplate.send(rabbitStreamTemplate
.messageBuilder().addData(converter.convert(domainObject))
.applicationProperties().entry("ROUTING_KEY",domainObject.getId())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space after comma.
Also, looks like there are indents problems in this code.
No need in exta from the left.
Plus they have to be spaces, not tabs.

.messageBuilder().build());
----

You can also publish over AMQP, using the `RabbitTemplate`.

[[super-stream-consumer]]
Expand Down