diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index 04f1737b79..fd6e7f55ff 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -8,13 +8,13 @@ The reference documentation consists of the following sections: [horizontal] xref:spring-cloud-stream.adoc#spring-cloud-stream-reference[Overview] :: History, Quick Start, Concepts, Architecture Overview, Binder Abstraction, and Core Features -xref:rabbit/spring-cloud-stream-binder-rabbit.adoc[Rabbit MQ Binder] :: Spring Cloud Stream binder reference for Rabbit MQ +xref:rabbit/spring-cloud-stream-binder-rabbit.adoc[Rabbit MQ Binder] :: Spring Cloud Stream binder reference for RabbitMQ xref:kafka/spring-cloud-stream-binder-kafka.adoc[Apache Kafka Binder] :: Spring Cloud Stream binder reference for Apache Kafka xref:kafka/kafka-streams.adoc[Apache Kafka Streams Binder] :: Spring Cloud Stream binder reference for Apache Kafka Streams xref:pulsar/spring-cloud-stream-binder-pulsar.adoc[Apache Pulsar Binder] :: Spring Cloud Stream binder reference for Apache Pulsar https://github.com/SolaceProducts/solace-spring-cloud/tree/master/solace-spring-cloud-starters/solace-spring-cloud-stream-starter#spring-cloud-stream-binder-for-solace-pubsub[Solace PubSub+ Binder] :: Spring Cloud Stream binder reference for Solace PubSub+ (Partner Maintained) -xref:spring-cloud-stream/overview-error-handling.adoc#spring-cloud-stream-overview-binders[Additional Binders] :: A collection of Partner maintained binder implementations for Spring Cloud Stream (e.g., Azure Event Hubs, Google PubSub, Solace PubSub+) +xref:spring-cloud-stream/binders.adoc[Additional Binders] :: A collection of Partner maintained binder implementations for Spring Cloud Stream (e.g., Azure Event Hubs, Google PubSub, Solace PubSub+) xref:schema-registry/spring-cloud-stream-schema-registry.adoc[Schema Registry] :: Spring Cloud Stream Schema Registry Reference https://github.com/spring-cloud/spring-cloud-stream-samples/[Spring Cloud Stream Samples] :: A curated collection of repeatable Spring Cloud Stream samples to walk through the features diff --git a/docs/modules/ROOT/pages/intro.adoc b/docs/modules/ROOT/pages/intro.adoc deleted file mode 100644 index f109776e32..0000000000 --- a/docs/modules/ROOT/pages/intro.adoc +++ /dev/null @@ -1,75 +0,0 @@ -Spring Cloud Stream is a framework for building message-driven microservice applications. -Spring Cloud Stream builds upon Spring Boot to create standalone, production-grade Spring applications and uses Spring Integration to provide connectivity to message brokers. -It provides opinionated configuration of middleware from several vendors, introducing the concepts of persistent publish-subscribe semantics, consumer groups, and partitions. -These are called binder implementations in the parlance of Spring Cloud Stream. -Out of the box, Spring Cloud Stream provides binder implementations for Apache Kafka and RabbitMQ. -While these two binder implementations are based on Message Channels, Spring Cloud Stream also provides another binder implementation for Kafka Streams that does not use message channels, but native Kafka Streams types such as KStream, KTable etc. - -Below, you can find more information on how to use these various out-of-the-box binder implementations in your applications. - -[[apache-kafka-binder]] -== Apache Kafka Binder - -[[usage]] -=== Usage - -To use Apache Kafka binder, you need to add `spring-cloud-stream-binder-kafka` as a dependency to your Spring Cloud Stream application, as shown in the following example for Maven: - -[source,xml] ----- - - org.springframework.cloud - spring-cloud-stream-binder-kafka - ----- - -Alternatively, you can also use the Spring Cloud Stream Kafka Starter, as shown in the following example for Maven: - -[source,xml] ----- - - org.springframework.cloud - spring-cloud-starter-stream-kafka - ----- - -[[apache-kafka-streams-binder]] -== Apache Kafka Streams Binder - -[[apache-kafka-streams-binder-usage]] -=== Usage - -To use Apache Kafka Streams binder, you need to add `spring-cloud-stream-binder-kafka-streams` as a dependency to your Spring Cloud Stream application, as shown in the following example for Maven: - -[source,xml] ----- - - org.springframework.cloud - spring-cloud-stream-binder-kafka-streams - ----- - -[[rabbitmq-binder]] -== RabbitMQ Binder -[[rabbitmq-binder-usage]] -=== Usage - -To use the RabbitMQ binder, you can add it to your Spring Cloud Stream application, by using the following Maven coordinates: - -[source,xml] ----- - - org.springframework.cloud - spring-cloud-stream-binder-rabbit - ----- - -Alternatively, you can use the Spring Cloud Stream RabbitMQ Starter, as follows: - -[source,xml] ----- - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - ----- diff --git a/docs/modules/ROOT/pages/kafka/kafka-binder/custom-health-ind.adoc b/docs/modules/ROOT/pages/kafka/kafka-binder/custom-health-ind.adoc index f2a408c59f..e7e4b31762 100644 --- a/docs/modules/ROOT/pages/kafka/kafka-binder/custom-health-ind.adoc +++ b/docs/modules/ROOT/pages/kafka/kafka-binder/custom-health-ind.adoc @@ -92,7 +92,8 @@ The bean is only registered as an ordinary health indicator of the application. To provide a custom health indicator for a particular binder, declare the `KafkaBinderHealth` bean in a configuration class and add that class to the context of the binder with `spring.main.sources`, which you set in the `environment` of the binder. -``` +[source,java] +---- @Configuration public class Kafka1HealthConfiguration { @@ -101,13 +102,14 @@ public class Kafka1HealthConfiguration { return new KafkaBinderHealthImplementation(...); } } -``` +---- -``` +[source,properties] +---- spring.cloud.stream.binders.kafka1.type=kafka spring.cloud.stream.binders.kafka1.environment.spring.main.sources=com.example.Kafka1HealthConfiguration spring.cloud.stream.binders.kafka2.type=kafka -``` +---- Do not annotate this class so that it is component scanned by the application, otherwise the bean is registered in the application context as well. In this example only the `kafka1` binder uses the custom health indicator, while `kafka2` keeps the default one. diff --git a/docs/modules/ROOT/pages/sagan-index.adoc b/docs/modules/ROOT/pages/sagan-index.adoc deleted file mode 100644 index 1126bafc4f..0000000000 --- a/docs/modules/ROOT/pages/sagan-index.adoc +++ /dev/null @@ -1,26 +0,0 @@ -Spring Cloud Stream is a framework for building highly scalable event-driven microservices connected with shared messaging systems. - -The framework provides a flexible programming model built on already established and familiar Spring idioms and best practices, including support -for persistent pub/sub semantics, consumer groups, and stateful partitions. - -## Binder Implementations - -Spring Cloud Stream supports a variety of binder implementations and the following table includes the link to the GitHub projects. - -* https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit[RabbitMQ] -* https://github.com/spring-cloud/spring-cloud-stream-binder-kafka[Apache Kafka] -* https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/tree/master/spring-cloud-stream-binder-kafka-streams[Kafka Streams] -* https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis[Amazon Kinesis] -* https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-pubsub-stream-binder[Google PubSub _(partner maintained)_] -* https://github.com/SolaceProducts/solace-spring-cloud/tree/master/solace-spring-cloud-starters/solace-spring-cloud-stream-starter#spring-cloud-stream-binder-for-solace-pubsub[Solace PubSub+ _(partner maintained)_] -* https://aka.ms/spring/docs#spring-cloud-stream-binder-for-azure-event-hubs[Azure Event Hubs _(partner maintained)_] -* https://aka.ms/spring/docs#spring-cloud-stream-binder-for-azure-service-bus[Azure Service Bus _(partner maintained)_] -* https://github.com/alibaba/spring-cloud-alibaba/wiki/RocketMQ-en[Apache RocketMQ _(partner maintained)_] - -The core building blocks of Spring Cloud Stream are: - -* *Destination Binders*: Components responsible to provide integration with the external messaging systems. -* *Destination Bindings*: Bridge between the external messaging systems and application provided Producers and Consumers of messages (created by the Destination Binders). -* *Message*: The canonical data structure used by producers and consumers to communicate with Destination Binders (and thus other applications via external messaging systems). - - diff --git a/docs/modules/ROOT/pages/spring-cloud-stream/binder-customizer.adoc b/docs/modules/ROOT/pages/spring-cloud-stream/binder-customizer.adoc index e641313c72..54630fcddc 100644 --- a/docs/modules/ROOT/pages/spring-cloud-stream/binder-customizer.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-stream/binder-customizer.adoc @@ -10,7 +10,7 @@ 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] +[source,java] ---- @Bean public BinderCustomizer binderCustomizer() { @@ -18,9 +18,6 @@ public BinderCustomizer binderCustomizer() { if (binder instanceof KafkaMessageChannelBinder kafkaMessageChannelBinder) { kafkaMessageChannelBinder.setRebalanceListener(...); } - else if (binder instanceof KStreamBinder) { - ... - } else if (binder instanceof RabbitMessageChannelBinder) { ... } diff --git a/docs/modules/ROOT/pages/spring-cloud-stream/binding-properties.adoc b/docs/modules/ROOT/pages/spring-cloud-stream/binding-properties.adoc index b7eae19782..ad0ef79cf0 100644 --- a/docs/modules/ROOT/pages/spring-cloud-stream/binding-properties.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-stream/binding-properties.adoc @@ -12,7 +12,7 @@ public Function uppercase() { return v -> v.toUpperCase(); } ---- -there are two bindings named `uppercase-in-0` for input and `uppercase-out-0` for output. See <> for more details. +there are two bindings named `uppercase-in-0` for input and `uppercase-out-0` for output. See xref:spring-cloud-stream/binding-names.adoc[] for more details. NOTE: To avoid repetition, Spring Cloud Stream supports setting values for all bindings, in the format of `spring.cloud.stream.default.=` and `spring.cloud.stream.default..=` for common binding properties. @@ -42,12 +42,12 @@ See xref:spring-cloud-stream/consumer-groups.adoc[Consumer Groups]. Default: `null` (indicating an anonymous consumer). contentType:: The content type of this binding. -See `xref:spring-cloud-stream/binding-properties.adoc#content-type-management[Content Type Negotiation]`. +See xref:spring-cloud-stream/content-type.adoc[Content Type Negotiation]. + Default: `application/json`. binder:: The binder used by this binding. -See `xref:spring-cloud-stream/multiple-binders.adoc[Multiple Binders on the Classpath]` for details. +See xref:spring-cloud-stream/multiple-binders.adoc[Multiple Binders on the Classpath] for details. + Default: `null` (the default binder is used, if it exists). @@ -234,7 +234,7 @@ Default: false. [[advanced-producer-configuration]] == Advanced Producer Configuration -In some cases Producer Properties are not enough to properly configure a producing MessageHandler in the binder, or may be you prefer a programmatic approach +In some cases Producer Properties are not enough to properly configure a producing MessageHandler in the binder, or may be you prefer a programmatic approach while configuring such producing MessageHandler. Regardless of the reason, spring-cloud-stream provides `ProducerMessageHandlerCustomizer` to accomplish it. diff --git a/docs/modules/ROOT/pages/spring-cloud-stream/bindings.adoc b/docs/modules/ROOT/pages/spring-cloud-stream/bindings.adoc index 608e8b5913..c8bb1840b3 100644 --- a/docs/modules/ROOT/pages/spring-cloud-stream/bindings.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-stream/bindings.adoc @@ -5,7 +5,7 @@ As stated earlier, _Bindings_ provide a bridge between the external messaging system (e.g., queue, topic etc.) and application-provided _Producers_ and _Consumers_. The following example shows a fully configured and functioning Spring Cloud Stream application that receives the payload of the message -as a `String` type (see xref:spring-cloud-stream/content-type.adoc#content_type_management[Content Type Negotiation] section), logs it to the console and sends it down stream after converting it to upper case. +as a `String` type (see xref:spring-cloud-stream/content-type.adoc[Content Type Negotiation] section), logs it to the console and sends it down stream after converting it to upper case. [source, java] ---- diff --git a/docs/modules/ROOT/pages/spring-cloud-stream/content-type.adoc b/docs/modules/ROOT/pages/spring-cloud-stream/content-type.adoc index 307aa7de7a..e1aaa74244 100644 --- a/docs/modules/ROOT/pages/spring-cloud-stream/content-type.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-stream/content-type.adoc @@ -1,4 +1,4 @@ -[[content_type_management]] +[[content-type-management]] = Content Type Negotiation Data transformation is one of the core features of any message-driven microservice architecture. Given that, in Spring Cloud Stream, such data diff --git a/docs/modules/ROOT/pages/spring-cloud-stream/multiple-binders.adoc b/docs/modules/ROOT/pages/spring-cloud-stream/multiple-binders.adoc index 89d7b46ae2..8a16deaa8a 100644 --- a/docs/modules/ROOT/pages/spring-cloud-stream/multiple-binders.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-stream/multiple-binders.adoc @@ -17,7 +17,7 @@ The key represents an identifying name for the binder implementation, whereas th Binder selection can either be performed globally, using the `spring.cloud.stream.defaultBinder` property (for example, `spring.cloud.stream.defaultBinder=rabbit`) or individually, by configuring the binder on each binding. For instance, a processor application (that has bindings named `input` and `output` for read and write respectively) that reads from Kafka and writes to RabbitMQ can specify the following configuration: -[source] +[source,properties] ---- spring.cloud.stream.bindings.input.binder=kafka spring.cloud.stream.bindings.output.binder=rabbit diff --git a/docs/modules/ROOT/pages/spring-cloud-stream/multiple-systems.adoc b/docs/modules/ROOT/pages/spring-cloud-stream/multiple-systems.adoc index a628c3a151..e26eb88367 100644 --- a/docs/modules/ROOT/pages/spring-cloud-stream/multiple-systems.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-stream/multiple-systems.adoc @@ -12,7 +12,7 @@ This denotes a configuration that exists independently of the default binder con The following example shows a typical configuration for a processor application that connects to two RabbitMQ broker instances: -[source,yml] +[source,yaml] ---- spring: cloud: