File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/reference/antora/modules/ROOT/pages Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -262,12 +262,24 @@ You must add a `superStreamRoutingFunction` to the `RabbitStreamTemplate`:
262262RabbitStreamTemplate streamTemplate(Environment env) {
263263 RabbitStreamTemplate template = new RabbitStreamTemplate(env, "stream.queue1");
264264 template.setSuperStreamRouting(message -> {
265- // some logic to return a String for the client's hashing algorithm
265+ // some logic to return a String for the client's routing hashing algorithm
266+ return message.getApplicationProperties().get("ROUTING_KEY").toString();
266267 });
267268 return template;
268269}
269270----
270271
272+ The following is an example of sending a message using a RabbitStreamTemplate
273+
274+ [source, java]
275+ ----
276+ //Send a message with the routing property for the hashing algorithm
277+ rabbitStreamTemplate.send(rabbitStreamTemplate
278+ .messageBuilder().addData(converter.convert(domainObject))
279+ .applicationProperties().entry("ROUTING_KEY",domainObject.getId())
280+ .messageBuilder().build());
281+ ----
282+
271283You can also publish over AMQP, using the `RabbitTemplate`.
272284
273285[[super-stream-consumer]]
You can’t perform that action at this time.
0 commit comments