From 245e80ab52a114b96a4d587462f05e89ccb89ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D0=B8=D0=BD=D1=8B=D1=85=20=D0=98=D0=BB?= =?UTF-8?q?=D1=8C=D1=8F=20=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B5=D0=B2=D0=B8?= =?UTF-8?q?=D1=87?= Date: Tue, 13 Apr 2021 19:01:57 +0300 Subject: [PATCH] Fixed spring-cloud-stream.adoc documentation rendering --- .../main/asciidoc/spring-cloud-stream.adoc | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-stream.adoc b/docs/src/main/asciidoc/spring-cloud-stream.adoc index 6da28de91..691adbc60 100644 --- a/docs/src/main/asciidoc/spring-cloud-stream.adoc +++ b/docs/src/main/asciidoc/spring-cloud-stream.adoc @@ -1734,22 +1734,23 @@ The user must check for the binder type and then apply the necessary customizati Here is an example of providing a `BinderCustomizer` bean. -``` +[source, java] +---- @Bean public BinderCustomizer binderCustomizer() { return (binder, binderName) -> { if (binder instanceof KafkaMessageChannelBinder) { - ((KafkaMessageChannelBinder) binder).setRebalanceListener(...); + ((KafkaMessageChannelBinder) binder).setRebalanceListener(/*...*/); } else if (binder instanceof KStreamBinder) { - ... + // ... } else if (binder instanceof RabbitMessageChannelBinder) { - ... + // ... } }; } -``` +---- Note that, when there are more than one instance of the same type of the binder, the binder name can be used to filter customization. @@ -1771,7 +1772,8 @@ BindingsLifecycleController bindingsController = context.getBean(BindingsLifecyc Binding binding = bindingsController.queryState("echo-in-0"); assertThat(binding.isRunning()).isTrue(); bindingsController.changeState("echo-in-0", State.STOPPED); -//bindingsController.stop("echo-in-0") alternative way of changing state. For convenience we expose start/stop and pause/resume operations. +//Alternative way of changing state. For convenience we expose start/stop and pause/resume operations. +//bindingsController.stop("echo-in-0") assertThat(binding.isRunning()).isFalse(); ---- @@ -2726,7 +2728,7 @@ Below is the example of the required Maven POM entries. Or for build.gradle.kts [source,kotlin] ---- +---- testImplementation("org.springframework.cloud:spring-cloud-stream") { artifact { name = "spring-cloud-stream" @@ -2735,7 +2737,7 @@ testImplementation("org.springframework.cloud:spring-cloud-stream") { classifier = "test-binder" } } ---- +---- @@ -2932,7 +2934,7 @@ public static class SamplePolledConfiguration { The above (very rudimentary) example will produce 3 messages in 2 second intervals sending them to the output destination of `Source` which this binder sends to `OutputDestination` where we retrieve them (for any assertions). -Currently it prints the following: +Currently, it prints the following: [source, text] ---- Message 1: POLLED DATA