diff --git a/README.adoc b/README.adoc index f4af5e925..c976d1b8c 100644 --- a/README.adoc +++ b/README.adoc @@ -1,54 +1,2612 @@ -== Spring Cloud Stream image:https://badge.waffle.io/spring-cloud/spring-cloud-stream.svg?label=ready&title=Ready[Stories Ready, link=http://waffle.io/spring-cloud/spring-cloud-stream] image:https://badge.waffle.io/spring-cloud/spring-cloud-stream.svg?label=In%20Progress&title=In%20Progress[Stores In Progress, link=http://waffle.io/spring-cloud/spring-cloud-stream] image:https://badges.gitter.im/spring-cloud/spring-cloud-stream.svg[link="https://gitter.im/spring-cloud/spring-cloud-stream?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"] - -This project allows a user to develop and run messaging microservices using Spring Integration and run them locally or in the cloud. Just add `@EnableBinding` and run your app as a Spring Boot app (single application context). - -Since version 1.1, Spring Cloud Stream follows a decentralized model where the core components and the binder implementations are developed and released separately. -This repository contains the core components of the project and does not contain any binder implementations. - -The repository for the Spring Cloud Stream Release Train is here: https://github.com/spring-cloud/spring-cloud-stream-starters - -Information on the Spring Cloud Stream release train can be found here: https://github.com/spring-cloud/spring-cloud-stream-starters/wiki#release-notes. - -=== Binder implementations - -The following binder implementations are currently available: - -* *Kafka* https://github.com/spring-cloud/spring-cloud-stream-binder-kafka -* *RabbitMQ* https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit - -=== Documentation - -The latest documentation for the project can be found http://docs.spring.io/spring-cloud-stream/docs/current-snapshot/reference/htmlsingle/[here]. - -=== Samples - -For Spring Cloud Stream samples, take a look to the https://github.com/spring-cloud/spring-cloud-stream-samples[samples repository]. - -=== Question, Bugs and Enhancements - -The project team is happy to receive feedback from the community and answer questions. - -We use Git Hub issues for tracking bugs and feature requests. -If you would like to report a bug or to suggest a feature, please open a Git Hub issue. - -Any question that is not a bug or an issue should be asked on Stack Overflow, using the tag http://stackoverflow.com/questions/tagged/spring-cloud-stream[`spring-cloud-stream`]. - -=== Contributing - -We love contributions. Follow this https://github.com/spring-cloud/spring-cloud-commons#contributing[link] for more information on how to contribute. - -=== Code formatting guidelines - -* The directory `eclipse` contains two files that can be used to configure the formatting rules in your IDE: `eclipse-code-formatter.xml` for the majority of the code formatting rules and `eclipse.importorder` to order the import statements. - -* In Eclipse you import these files by navigating `Windows -> Preferences` and then the menu items `Preferences > Java > Code Style > Formatter` and `Preferences > Java > Code Style > Organize Imports` respectively. - -* In `IntelliJ`, install the plugin `Eclipse Code Formatter`. -You can find it by searching the "Browse Repositories" under the plugin option within `IntelliJ` (Once installed you will need to reboot Intellij for it to take effect). -Then navigate to `Intellij IDEA > Preferences` and select the Eclipse Code Formatter. -Select the `eclipse-code-formatter.xml` file for the field `Eclipse Java Formatter config file` and the file `eclipse.importorder` for the field `Import order`. -Enable the `Eclipse code formatter` by clicking `Use the Eclipse code formatter` then click the *OK* button. -** NOTE: If you configure the `Eclipse Code Formatter` from `File > Other Settings > Default Settings` it will set this policy across all of your Intellij projects. - -== Code of Conduct -This project adheres to the Contributor Covenant link:CODE_OF_CONDUCT.adoc[code of conduct]. By participating, you are expected to uphold this code. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io. +// Do not edit this file (e.g. go instead to src/main/asciidoc) + +:github-tag: master +:github-repo: spring-cloud/spring-cloud-stream +:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag} +:github-code: https://github.com/{github-repo}/tree/{github-tag} +:toc: left +:toclevels: 8 +:nofooter: +:sectlinks: true + +[partintro] +-- +This section goes into more detail about how you can work with Spring Cloud Stream. +It covers topics such as creating and running stream applications. +-- + +[[spring-cloud-stream-overview-introducing]] +== Introducing Spring Cloud Stream + +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. + +You can add the `@EnableBinding` annotation to your application to get immediate connectivity to a message broker, and you can add `@StreamListener` to a method to cause it to receive events for stream processing. +The following example shows a sink application that receives external messages: + +[source,java] +---- +@SpringBootApplication +@EnableBinding(Sink.class) +public class VoteRecordingSinkApplication { + + public static void main(String[] args) { + SpringApplication.run(VoteRecordingSinkApplication.class, args); + } + + @StreamListener(Sink.INPUT) + public void processVote(Vote vote) { + votingService.recordVote(vote); + } +} +---- + +The `@EnableBinding` annotation takes one or more interfaces as parameters (in this case, the parameter is a single `Sink` interface). +An interface declares input and output channels. +Spring Cloud Stream provides the `Source`, `Sink`, and `Processor` interfaces. You can also define your own interfaces. + +The following listing shows the definition of the `Sink` interface: + +[source,java] +---- +public interface Sink { + String INPUT = "input"; + + @Input(Sink.INPUT) + SubscribableChannel input(); +} +---- + +The `@Input` annotation identifies an input channel, through which received messages enter the application. +The `@Output` annotation identifies an output channel, through which published messages leave the application. +The `@Input` and `@Output` annotations can take a channel name as a parameter. +If a name is not provided, the name of the annotated method is used. + +Spring Cloud Stream creates an implementation of the interface for you. +You can use this in the application by autowiring it, as shown in the following example (from a test case): + +[source,java] +---- +@RunWith(SpringJUnit4ClassRunner.class) +@SpringApplicationConfiguration(classes = VoteRecordingSinkApplication.class) +@WebAppConfiguration +@DirtiesContext +public class StreamApplicationTests { + + @Autowired + private Sink sink; + + @Test + public void contextLoads() { + assertNotNull(this.sink.input()); + } +} +---- + +== Main Concepts + +Spring Cloud Stream provides a number of abstractions and primitives that simplify the writing of message-driven microservice applications. +This section gives an overview of the following: + +* <> +* <> +* <> +* <> +* <> +* <> + +[[spring-cloud-stream-overview-application-model]] +=== Application Model + +A Spring Cloud Stream application consists of a middleware-neutral core. +The application communicates with the outside world through input and output channels injected into it by Spring Cloud Stream. +Channels are connected to external brokers through middleware-specific Binder implementations. + +.Spring Cloud Stream Application +image::{github-raw}/docs/src/main/asciidoc/images/SCSt-with-binder.png[width=800,scaledwidth="75%",align="center"] + +==== Fat JAR + +Spring Cloud Stream applications can be run in stand-alone mode from your IDE for testing. +To run a Spring Cloud Stream application in production, you can create an executable (or "`fat`") JAR by using the standard Spring Boot tooling provided for Maven or Gradle. See the https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-create-an-executable-jar-with-maven[Spring Boot Reference Guide] for more details. + +[[spring-cloud-stream-overview-binder-abstraction]] +=== The Binder Abstraction + +Spring Cloud Stream provides Binder implementations for https://github.com/spring-cloud/spring-cloud-stream-binder-kafka[Kafka] and https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit[Rabbit MQ]. +Spring Cloud Stream also includes a https://github.com/spring-cloud/spring-cloud-stream/blob/master/spring-cloud-stream-test-support/src/main/java/org/springframework/cloud/stream/test/binder/TestSupportBinder.java[TestSupportBinder], which leaves a channel unmodified so that tests can interact with channels directly and reliably assert on what is received. +You can also use the extensible API to write your own Binder. + +Spring Cloud Stream uses Spring Boot for configuration, and the Binder abstraction makes it possible for a Spring Cloud Stream application to be flexible in how it connects to middleware. +For example, deployers can dynamically choose, at runtime, the destinations (such as the Kafka topics or RabbitMQ exchanges) to which channels connect. +Such configuration can be provided through external configuration properties and in any form supported by Spring Boot (including application arguments, environment variables, and `application.yml` or `application.properties` files). +In the sink example from the <> section, setting the `spring.cloud.stream.bindings.input.destination` application property to `raw-sensor-data` causes it to read from the `raw-sensor-data` Kafka topic or from a queue bound to the `raw-sensor-data` RabbitMQ exchange. + +Spring Cloud Stream automatically detects and uses a binder found on the classpath. +You can use different types of middleware with the same code. +To do so, include a different binder at build time. +For more complex use cases, you can also package multiple binders with your application and have it choose the binder( and even whether to use different binders for different channels) at runtime. + +[[spring-cloud-stream-overview-persistent-publish-subscribe-support]] +=== Persistent Publish-Subscribe Support + +Communication between applications follows a publish-subscribe model, where data is broadcast through shared topics. +This can be seen in the following figure, which shows a typical deployment for a set of interacting Spring Cloud Stream applications. + +.Spring Cloud Stream Publish-Subscribe +image::SCSt-sensors.png[width=800,scaledwidth="75%",align="center"] + +Data reported by sensors to an HTTP endpoint is sent to a common destination named `raw-sensor-data`. +From the destination, it is independently processed by a microservice application that computes time-windowed averages and by another microservice application that ingests the raw data into HDFS (Hadoop Distributed File System). +In order to process the data, both applications declare the topic as their input at runtime. + +The publish-subscribe communication model reduces the complexity of both the producer and the consumer and lets new applications be added to the topology without disruption of the existing flow. +For example, downstream from the average-calculating application, you can add an application that calculates the highest temperature values for display and monitoring. +You can then add another application that interprets the same flow of averages for fault detection. +Doing all communication through shared topics rather than point-to-point queues reduces coupling between microservices. + +While the concept of publish-subscribe messaging is not new, Spring Cloud Stream takes the extra step of making it an opinionated choice for its application model. +By using native middleware support, Spring Cloud Stream also simplifies use of the publish-subscribe model across different platforms. + +[[consumer-groups]] +=== Consumer Groups +While the publish-subscribe model makes it easy to connect applications through shared topics, the ability to scale up by creating multiple instances of a given application is equally important. +When doing so, different instances of an application are placed in a competing consumer relationship, where only one of the instances is expected to handle a given message. + +Spring Cloud Stream models this behavior through the concept of a consumer group. +(Spring Cloud Stream consumer groups are similar to and inspired by Kafka consumer groups.) +Each consumer binding can use the `spring.cloud.stream.bindings..group` property to specify a group name. +For the consumers shown in the following figure, this property would be set as `spring.cloud.stream.bindings..group=hdfsWrite` or `spring.cloud.stream.bindings..group=average`. + +.Spring Cloud Stream Consumer Groups +image::SCSt-groups.png[width=800,scaledwidth="75%",align="center"] + +All groups that subscribe to a given destination receive a copy of published data, but only one member of each group receives a given message from that destination. +By default, when a group is not specified, Spring Cloud Stream assigns the application to an anonymous and independent single-member consumer group that is in a publish-subscribe relationship with all other consumer groups. + +[[consumer-types]] +=== Consumer Types + +Two types of consumer are supported: + +* Message-driven (sometimes referred to as Asynchronous) +* Polled (sometimes referred to as Synchronous) + +Prior to version 2.0, only asynchronous consumers were supported. A message is delivered as soon as it is available and a thread is available to process it. + +When you wish to control the rate at which messages are processed, you might want to use a synchronous consumer. +// TODO This needs more description. A sentence parallel to the last sentence of the preceding paragraph would help. + +[[durability]] +==== Durability + +Consistent with the opinionated application model of Spring Cloud Stream, consumer group subscriptions are durable. +That is, a binder implementation ensures that group subscriptions are persistent and that, once at least one subscription for a group has been created, the group receives messages, even if they are sent while all applications in the group are stopped. + +[NOTE] +==== +Anonymous subscriptions are non-durable by nature. +For some binder implementations (such as RabbitMQ), it is possible to have non-durable group subscriptions. +==== + +In general, it is preferable to always specify a consumer group when binding an application to a given destination. +When scaling up a Spring Cloud Stream application, you must specify a consumer group for each of its input bindings. +Doing so prevents the application's instances from receiving duplicate messages (unless that behavior is desired, which is unusual). + +[[partitioning]] +=== Partitioning Support + +Spring Cloud Stream provides support for partitioning data between multiple instances of a given application. +In a partitioned scenario, the physical communication medium (such as the broker topic) is viewed as being structured into multiple partitions. +One or more producer application instances send data to multiple consumer application instances and ensure that data identified by common characteristics are processed by the same consumer instance. + +Spring Cloud Stream provides a common abstraction for implementing partitioned processing use cases in a uniform fashion. +Partitioning can thus be used whether the broker itself is naturally partitioned (for example, Kafka) or not (for example, RabbitMQ). + +.Spring Cloud Stream Partitioning +image::SCSt-partitioning.png[width=800,scaledwidth="75%",align="center"] + +Partitioning is a critical concept in stateful processing, where it is critical (for either performance or consistency reasons) to ensure that all related data is processed together. +For example, in the time-windowed average calculation example, it is important that all measurements from any given sensor are processed by the same application instance. + +NOTE: To set up a partitioned processing scenario, you must configure both the data-producing and the data-consuming ends. + +== Programming Model + +To understand the programming model, you should be familiar with the following core concepts: + +* *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). + +image::SCSt-overview.png[width=800,scaledwidth="75%",align="center"] + +=== Destination Binders + +Destination Binders are extension components of Spring Cloud Stream responsible for providing the necessary configuration and implementation to facilitate +integration with external messaging systems. +This integration is responsible for connectivity, delegation, and routing of messages to and from producers and consumers, data type conversion, +invocation of the user code, and more. + +Binders handle a lot of the boiler plate responsibilities that would otherwise fall on your shoulders. However, to accomplish that, the binder still needs +some help in the form of minimalistic yet required set of instructions from the user, which typically come in the form of some type of configuration. + +While it is out of scope of this section to discuss all of the available binder and binding configuration options (the rest of the manual covers them extensively), +_Destination Binding_ does require special attention. The next section discusses it in detail. + +=== Destination Bindings + +As stated earlier, _Destination Bindings_ provide a bridge between the external messaging system and application-provided _Producers_ and _Consumers_. + +Applying the @EnableBinding annotation to one of the application’s configuration classes defines a destination binding. +The `@EnableBinding` annotation itself is meta-annotated with `@Configuration` and triggers the configuration of the Spring Cloud Stream infrastructure. + +The following example shows a fully configured and functioning Spring Cloud Stream application that receives the payload of the message from the `INPUT` +destination as a `String` type (see <> section), logs it to the console and sends it to the `OUTPUT` destination after converting it to upper case. + +[source, java] +---- +@SpringBootApplication +@EnableBinding(Processor.class) +public class MyApplication { + + public static void main(String[] args) { + SpringApplication.run(MyApplication.class, args); + } + + @StreamListener(Processor.INPUT) + @SendTo(Processor.OUTPUT) + public String handle(String value) { + System.out.println("Received: " + value); + return value.toUpperCase(); + } +} +---- + +As you can see the `@EnableBinding` annotation can take one or more interface classes as parameters. The parameters are referred to as _bindings_, +and they contain methods representing _bindable components_. +These components are typically message channels (see https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-messaging.html[Spring Messaging]) +for channel-based binders (such as Rabbit, Kafka, and others). However other types of bindings can +provide support for the native features of the corresponding technology. For example Kafka Streams binder (formerly known as KStream) allows native bindings directly to Kafka Streams +(see https://docs.spring.io/autorepo/docs/spring-cloud-stream-binder-kafka-docs/1.1.0.M1/reference/htmlsingle/[Kafka Streams] for more details). + +Spring Cloud Stream already provides _binding_ interfaces for typical message exchange contracts, which include: + +* *Sink:* Identifies the contract for the message consumer by providing the destination from which the message is consumed. +* *Source:* Identifies the contract for the message producer by providing the destination to which the produced message is sent. +* *Processor:* Encapsulates both the sink and the source contracts by exposing two destinations that allow consumption and production of messages. + +[source, java] +---- +public interface Sink { + + String INPUT = "input"; + + @Input(Sink.INPUT) + SubscribableChannel input(); +} +---- + +[source, java] +---- +public interface Source { + + String OUTPUT = "output"; + + @Output(Source.OUTPUT) + MessageChannel output(); +} +---- + +[source, java] +---- +public interface Processor extends Source, Sink {} +---- + +While the preceding example satisfies the majority of cases, you can also define your own contracts by defining your own bindings interfaces and use `@Input` and `@Output` +annotations to identify the actual _bindable components_. + +For example: + +[source, java] +---- +public interface Barista { + + @Input + SubscribableChannel orders(); + + @Output + MessageChannel hotDrinks(); + + @Output + MessageChannel coldDrinks(); +} +---- + +Using the interface shown in the preceding example as a parameter to `@EnableBinding` triggers the creation of the three bound channels named `orders`, `hotDrinks`, and `coldDrinks`, +respectively. + +You can provide as many binding interfaces as you need, as arguments to the `@EnableBinding` annotation, as shown in the following example: + +[source, java] +---- +@EnableBinding(value = { Orders.class, Payment.class }) +---- + +In Spring Cloud Stream, the bindable `MessageChannel` components are the Spring Messaging `MessageChannel` (for outbound) and its extension, `SubscribableChannel`, +(for inbound). + +*Pollable Destination Binding* + +While the previously described bindings support event-based message consumption, sometimes you need more control, such as rate of consumption. + +Starting with version 2.0, you can now bind a pollable consumer: + +The following example shows how to bind a pollable consumer: + +[source, java] +---- +public interface PolledBarista { + + @Input + PollableMessageSource orders(); + . . . +} +---- + +In this case, an implementation of `PollableMessageSource` is bound to the `orders` “channel”. See <> for more details. + +*Customizing Channel Names* + +By using the `@Input` and `@Output` annotations, you can specify a customized channel name for the channel, as shown in the following example: + +[source, java] +---- +public interface Barista { + @Input("inboundOrders") + SubscribableChannel orders(); +} +---- + +In the preceding example, the created bound channel is named `inboundOrders`. + +Normally, you need not access individual channels or bindings directly (other then configuring them via `@EnableBinding` annotation). However there may be +times, such as testing or other corner cases, when you do. + +Aside from generating channels for each binding and registering them as Spring beans, for each bound interface, Spring Cloud Stream generates a bean that implements the interface. +That means you can have access to the interfaces representing the bindings or individual channels by auto-wiring either in your application, as shown in the following two examples: + +_Autowire Binding interface_ + +[source, java] +---- +@Autowire +private Source source + +public void sayHello(String name) { + source.output().send(MessageBuilder.withPayload(name).build()); +} +---- + +_Autowire individual channel_ + +[source, java] +---- +@Autowire +private MessageChannel output; + +public void sayHello(String name) { + output.send(MessageBuilder.withPayload(name).build()); +} +---- + +You can also use standard Spring's `@Qualifier` annotation for cases when channel names are customized or in multiple-channel scenarios that require specifically named channels. + +The following example shows how to use the @Qualifier annotation in this way: + +[source, java] +---- +@Autowire +@Qualifier("myChannel") +private MessageChannel output; +---- + +[[spring-cloud-stream-overview-producing-consuming-messages]] +=== Producing and Consuming Messages + +You can write a Spring Cloud Stream application by using either Spring Integration annotations or Spring Cloud Stream native annotation. + +==== Spring Integration Support + +Spring Cloud Stream is built on the concepts and patterns defined by http://www.enterpriseintegrationpatterns.com/[Enterprise Integration Patterns] and relies +in its internal implementation on an already established and popular implementation of Enterprise Integration Patterns within the Spring portfolio of projects: +https://projects.spring.io/spring-integration/[Spring Integration] framework. + +So its only natural for it to support the foundation, semantics, and configuration options that are already established by Spring Integration + +For example, you can attach the output channel of a `Source` to a `MessageSource` and use the familiar `@InboundChannelAdapter` annotation, as follows: + +[source, java] +---- +@EnableBinding(Source.class) +public class TimerSource { + + @Bean + @InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "10", maxMessagesPerPoll = "1")) + public MessageSource timerMessageSource() { + return () -> new GenericMessage<>("Hello Spring Cloud Stream"); + } +} +---- + +Similarly, you can use @Transformer or @ServiceActivator while providing an implementation of a message handler method for a _Processor_ binding contract, as shown in the following example: + +[source,java] +---- +@EnableBinding(Processor.class) +public class TransformProcessor { + @Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT) + public Object transform(String message) { + return message.toUpperCase(); + } +} +---- + +NOTE: While this may be skipping ahead a bit, it is important to understand that, when you consume from the same binding using `@StreamListener` annotation, a pub-sub model is used. +Each method annotated with `@StreamListener` receives its own copy of a message, and each one has its own consumer group. +However, if you consume from the same binding by using one of the Spring Integration annotation (such as `@Aggregator`, `@Transformer`, or `@ServiceActivator`), those consume in a competing model. +No individual consumer group is created for each subscription. + +==== Using @StreamListener Annotation + +Complementary to its Spring Integration support, Spring Cloud Stream provides its own `@StreamListener` annotation, modeled after other Spring Messaging annotations +(`@MessageMapping`, `@JmsListener`, `@RabbitListener`, and others) and provides conviniences, such as content-based routing and others. + +[source,java] +---- +@EnableBinding(Sink.class) +public class VoteHandler { + + @Autowired + VotingService votingService; + + @StreamListener(Sink.INPUT) + public void handle(Vote vote) { + votingService.record(vote); + } +} +---- + +As with other Spring Messaging methods, method arguments can be annotated with `@Payload`, `@Headers`, and `@Header`. + + +For methods that return data, you must use the `@SendTo` annotation to specify the output binding destination for data returned by the method, as shown in the following example: + +[source,java] +---- +@EnableBinding(Processor.class) +public class TransformProcessor { + + @Autowired + VotingService votingService; + + @StreamListener(Processor.INPUT) + @SendTo(Processor.OUTPUT) + public VoteResult handle(Vote vote) { + return votingService.record(vote); + } +} +---- + + +==== Using @StreamListener for Content-based routing + +Spring Cloud Stream supports dispatching messages to multiple handler methods annotated with `@StreamListener` based on conditions. + +In order to be eligible to support conditional dispatching, a method must satisfy the follow conditions: + +* It must not return a value. +* It must be an individual message handling method (reactive API methods are not supported). + +The condition is specified by a SpEL expression in the `condition` argument of the annotation and is evaluated for each message. +All the handlers that match the condition are invoked in the same thread, and no assumption must be made about the order in which the invocations take place. + +In the following example of a `@StreamListener` with dispatching conditions, all the messages bearing a header `type` with the value `bogey` are dispatched to the +`receiveBogey` method, and all the messages bearing a header `type` with the value `bacall` are dispatched to the `receiveBacall` method. + +[source,java] +---- +@EnableBinding(Sink.class) +@EnableAutoConfiguration +public static class TestPojoWithAnnotatedArguments { + + @StreamListener(target = Sink.INPUT, condition = "headers['type']=='bogey'") + public void receiveBogey(@Payload BogeyPojo bogeyPojo) { + // handle the message + } + + @StreamListener(target = Sink.INPUT, condition = "headers['type']=='bacall'") + public void receiveBacall(@Payload BacallPojo bacallPojo) { + // handle the message + } +} +---- + +*Content Type Negotiation in the Context of `condition`* + +It is important to understand some of the mechanics behind content-based routing using the `condition` argument of `@StreamListener`, especially in the context of the type of the message as a whole. +It may also help if you familiarize yourself with the <> before you proceed. + +Consider the following scenario: + +[source,java] +---- +@EnableBinding(Sink.class) +@EnableAutoConfiguration +public static class CatsAndDogs { + + @StreamListener(target = Sink.INPUT, condition = "payload.class.simpleName=='Dog'") + public void bark(Dog dog) { + // handle the message + } + + @StreamListener(target = Sink.INPUT, condition = "payload.class.simpleName=='Cat'") + public void purr(Cat cat) { + // handle the message + } +} +---- + +The preceding code is perfectly valid. It compiles and deploys without any issues, yet it never produces the result you expect. + +That is because you are testing something that does not yet exist in a state you expect. That is because the payload of the message is not yet converted from the +wire format (`byte[]`) to the desired type. +In other words, it has not yet gone through the type conversion process described in the <>. + +So, unless you use a SPeL expression that evaluates raw data (for example, the value of the first byte in the byte array), use message header-based expressions +(such as `condition = "headers['type']=='dog'"`). + + +NOTE: At the moment, dispatching through `@StreamListener` conditions is supported only for channel-based binders (not for reactive programming) +support. + + +[[_spring_cloud_function]] +==== Spring Cloud Function support + +Since Spring Cloud Stream v2.1, another alternative for defining _stream handlers_ and _sources_ is to use build-in +support for https://cloud.spring.io/spring-cloud-function/[Spring Cloud Function] where they can be expressed as beans of + type `java.util.function.[Supplier/Function/Consumer]`. + +To specify which functional bean to bind to the external destination(s) exposed by the bindings, you must provide `spring.cloud.stream.function.definition` property. + +Here is the example of the Processor application exposing message handler as `java.util.function.Function` +[source,java] +---- +@SpringBootApplication +@EnableBinding(Processor.class) +public class MyFunctionBootApp { + + public static void main(String[] args) { + SpringApplication.run(MyFunctionBootApp.class, "--spring.cloud.stream.function.definition=toUpperCase"); + } + + @Bean + public Function toUpperCase() { + return s -> s.toUpperCase(); + } +} +---- +In the above you we simply define a bean of type `java.util.function.Function` called _toUpperCase_ and identify it as a bean to be used as message handler +whose 'input' and 'output' must be bound to the external destinations exposed by the Processor binding. + +Below are the examples of simple functional applications to support Source, Processor and Sink. + +Here is the example of a Source application defined as `java.util.function.Supplier` +[source,java] +---- +@SpringBootApplication +@EnableBinding(Source.class) +public static class SourceFromSupplier { + public static void main(String[] args) { + SpringApplication.run(SourceFromSupplier.class, "--spring.cloud.stream.function.definition=date"); + } + @Bean + public Supplier date() { + return () -> new Date(12345L); + } +} +---- + +Here is the example of a Processor application defined as `java.util.function.Function` +[source,java] +---- +@SpringBootApplication +@EnableBinding(Processor.class) +public static class ProcessorFromFunction { + public static void main(String[] args) { + SpringApplication.run(ProcessorFromFunction.class, "--spring.cloud.stream.function.definition=toUpperCase"); + } + @Bean + public Function toUpperCase() { + return s -> s.toUpperCase(); + } +} +---- + +Here is the example of a Sink application defined as `java.util.function.Consumer` +[source,java] +---- +@EnableAutoConfiguration +@EnableBinding(Sink.class) +public static class SinkFromConsumer { + public static void main(String[] args) { + SpringApplication.run(SinkFromConsumer.class, "--spring.cloud.stream.function.definition=sink"); + } + @Bean + public Consumer sink() { + return System.out::println; + } +} +---- + +===== Functional Composition + +Using this programming model you can also benefit from functional composition where you can dynamically compose complex handlers from a set of simple functions. +As an example let's add the following function bean to the application defined above +[source,java] +---- +@Bean +public Function wrapInQuotes() { + return s -> "\"" + s + "\""; +} +---- +and modify the `spring.cloud.stream.function.definition` property to reflect your intention to compose a new function from both ‘toUpperCase’ and ‘wrapInQuotes’. +To do that Spring Cloud Function allows you to use `|` (pipe) symbol. So to finish our example our property will now look like this: + +[source,java] +---- +—spring.cloud.stream.function.definition=toUpperCase|wrapInQuotes +---- + + + +[[spring-cloud-streams-overview-using-polled-consumers]] +==== Using Polled Consumers + +===== Overview + +When using polled consumers, you poll the `PollableMessageSource` on demand. +Consider the following example of a polled consumer: + +[source,java] +---- +public interface PolledConsumer { + + @Input + PollableMessageSource destIn(); + + @Output + MessageChannel destOut(); + +} +---- + +Given the polled consumer in the preceding example, you might use it as follows: + +[source,java] +---- +@Bean +public ApplicationRunner poller(PollableMessageSource destIn, MessageChannel destOut) { + return args -> { + while (someCondition()) { + try { + if (!destIn.poll(m -> { + String newPayload = ((String) m.getPayload()).toUpperCase(); + destOut.send(new GenericMessage<>(newPayload)); + })) { + Thread.sleep(1000); + } + } + catch (Exception e) { + // handle failure + } + } + }; +} +---- + +The `PollableMessageSource.poll()` method takes a `MessageHandler` argument (often a lambda expression, as shown here). +It returns `true` if the message was received and successfully processed. + +As with message-driven consumers, if the `MessageHandler` throws an exception, messages are published to error channels, as discussed in "`<>`". + +Normally, the `poll()` method acknowledges the message when the `MessageHandler` exits. +If the method exits abnormally, the message is rejected (not re-queued), but see <>. +You can override that behavior by taking responsibility for the acknowledgment, as shown in the following example: + +[source,java] +---- +@Bean +public ApplicationRunner poller(PollableMessageSource dest1In, MessageChannel dest2Out) { + return args -> { + while (someCondition()) { + if (!dest1In.poll(m -> { + StaticMessageHeaderAccessor.getAcknowledgmentCallback(m).noAutoAck(); + // e.g. hand off to another thread which can perform the ack + // or acknowledge(Status.REQUEUE) + + })) { + Thread.sleep(1000); + } + } + }; +} +---- + +IMPORTANT: You must `ack` (or `nack`) the message at some point, to avoid resource leaks. + +IMPORTANT: Some messaging systems (such as Apache Kafka) maintain a simple offset in a log. If a delivery fails and is re-queued with `StaticMessageHeaderAccessor.getAcknowledgmentCallback(m).acknowledge(Status.REQUEUE);`, any later successfully ack'd messages are redelivered. + +There is also an overloaded `poll` method, for which the definition is as follows: + +[source,java] +---- +poll(MessageHandler handler, ParameterizedTypeReference type) +---- + +The `type` is a conversion hint that allows the incoming message payload to be converted, as shown in the following example: + +[source,java] +---- +boolean result = pollableSource.poll(received -> { + Map payload = (Map) received.getPayload(); + ... + + }, new ParameterizedTypeReference>() {}); +---- + +[[polled-errors]] +===== Handling Errors + +By default, an error channel is configured for the pollable source; if the callback throws an exception, an `ErrorMessage` is sent to the error channel (`..errors`); this error channel is also bridged to the global Spring Integration `errorChannel`. + +You can subscribe to either error channel with a `@ServiceActivator` to handle errors; without a subscription, the error will simply be logged and the message will be acknowledged as successful. +If the error channel service activator throws an exception, the message will be rejected (by default) and won't be redelivered. +If the service activator throws a `RequeueCurrentMessageException`, the message will be requeued at the broker and will be again retrieved on a subsequent poll. + +If the listener throws a `RequeueCurrentMessageException` directly, the message will be requeued, as discussed above, and will not be sent to the error channels. + +[[spring-cloud-stream-overview-error-handling]] +=== Error Handling + +Errors happen, and Spring Cloud Stream provides several flexible mechanisms to handle them. +The error handling comes in two flavors: + + * *application:* The error handling is done within the application (custom error handler). + + * *system:* The error handling is delegated to the binder (re-queue, DL, and others). Note that the techniques are dependent on binder implementation and the + capability of the underlying messaging middleware. + +Spring Cloud Stream uses the https://github.com/spring-projects/spring-retry[Spring Retry] library to facilitate successful message processing. See <> for more details. +However, when all fails, the exceptions thrown by the message handlers are propagated back to the binder. At that point, binder invokes custom error handler or communicates +the error back to the messaging system (re-queue, DLQ, and others). + +==== Application Error Handling + +There are two types of application-level error handling. Errors can be handled at each binding subscription or a global handler can handle all the binding subscription errors. Let's review the details. + +.A Spring Cloud Stream Sink Application with Custom and Global Error Handlers +image::custom_vs_global_error_channels.png[width=800,scaledwidth="75%",align="center"] + +For each input binding, Spring Cloud Stream creates a dedicated error channel with the following semantics `.errors`. + +NOTE: The `` consists of the name of the binding (such as `input`) and the name of the group (such as `myGroup`). + +Consider the following: + +[source,text] +---- +spring.cloud.stream.bindings.input.group=myGroup +---- + +[source,java] +---- +@StreamListener(Sink.INPUT) // destination name 'input.myGroup' +public void handle(Person value) { + throw new RuntimeException("BOOM!"); +} + +@ServiceActivator(inputChannel = Processor.INPUT + ".myGroup.errors") //channel name 'input.myGroup.errors' +public void error(Message message) { + System.out.println("Handling ERROR: " + message); +} +---- + +In the preceding example the destination name is `input.myGroup` and the dedicated error channel name is `input.myGroup.errors`. + +NOTE: The use of @StreamListener annotation is intended specifically to define bindings that bridge internal channels and external destinations. Given that the destination +specific error channel does NOT have an associated external destination, such channel is a prerogative of Spring Integration (SI). This means that the handler +for such destination must be defined using one of the SI handler annotations (i.e., @ServiceActivator, @Transformer etc.). + +NOTE: If `group` is not specified anonymous group is used (something like `input.anonymous.2K37rb06Q6m2r51-SPIDDQ`), which is not suitable for error +handling scenarious, since you don't know what it's going to be until the destination is created. + +Also, in the event you are binding to the existing destination such as: + +[source,text] +---- +spring.cloud.stream.bindings.input.destination=myFooDestination +spring.cloud.stream.bindings.input.group=myGroup +---- + +the full destination name is `myFooDestination.myGroup` and then the dedicated error channel name is `myFooDestination.myGroup.errors`. + +Back to the example... + +The `handle(..)` method, which subscribes to the channel named `input`, throws an exception. Given there is also a subscriber to the error channel `input.myGroup.errors` +all error messages are handled by this subscriber. + +If you have multiple bindings, you may want to have a single error handler. Spring Cloud Stream automatically provides support for +a _global error channel_ by bridging each individual error channel to the channel named `errorChannel`, allowing a single subscriber to handle all errors, +as shown in the following example: + +[source,java] +---- +@StreamListener("errorChannel") +public void error(Message message) { + System.out.println("Handling ERROR: " + message); +} +---- + +This may be a convenient option if error handling logic is the same regardless of which handler produced the error. + +==== System Error Handling + +System-level error handling implies that the errors are communicated back to the messaging system and, given that not every messaging system +is the same, the capabilities may differ from binder to binder. + +That said, in this section we explain the general idea behind system level error handling and use Rabbit binder as an example. NOTE: Kafka binder provides similar +support, although some configuration properties do differ. Also, for more details and configuration options, see the individual binder's documentation. + +If no internal error handlers are configured, the errors propagate to the binders, and the binders subsequently propagate those errors back to the messaging system. +Depending on the capabilities of the messaging system such a system may _drop_ the message, _re-queue_ the message for re-processing or _send the failed message to DLQ_. +Both Rabbit and Kafka support these concepts. However, other binders may not, so refer to your individual binder’s documentation for details on supported system-level +error-handling options. + +===== Drop Failed Messages + +By default, if no additional system-level configuration is provided, the messaging system drops the failed message. +While acceptable in some cases, for most cases, it is not, and we need some recovery mechanism to avoid message loss. + +===== DLQ - Dead Letter Queue + +DLQ allows failed messages to be sent to a special destination: - _Dead Letter Queue_. + +When configured, failed messages are sent to this destination for subsequent re-processing or auditing and reconciliation. + +For example, continuing on the previous example and to set up the DLQ with Rabbit binder, you need to set the following property: + +[source,text] +---- +spring.cloud.stream.rabbit.bindings.input.consumer.auto-bind-dlq=true +---- + +Keep in mind that, in the above property, `input` corresponds to the name of the input destination binding. +The `consumer` indicates that it is a consumer property and `auto-bind-dlq` instructs the binder to configure DLQ for `input` +destination, which results in an additional Rabbit queue named `input.myGroup.dlq`. + +Once configured, all failed messages are routed to this queue with an error message similar to the following: + +[source,text] +---- +delivery_mode: 1 +headers: +x-death: +count: 1 +reason: rejected +queue: input.hello +time: 1522328151 +exchange: +routing-keys: input.myGroup +Payload {"name”:"Bob"} +---- + +As you can see from the above, your original message is preserved for further actions. + +However, one thing you may have noticed is that there is limited information on the original issue with the message processing. For example, you do not see a stack +trace corresponding to the original error. +To get more relevant information about the original error, you must set an additional property: + +[source,text] +---- +spring.cloud.stream.rabbit.bindings.input.consumer.republish-to-dlq=true +---- + +Doing so forces the internal error handler to intercept the error message and add additional information to it before publishing it to DLQ. +Once configured, you can see that the error message contains more information relevant to the original error, as follows: + +[source,text] +---- +delivery_mode: 2 +headers: +x-original-exchange: +x-exception-message: has an error +x-original-routingKey: input.myGroup +x-exception-stacktrace: org.springframework.messaging.MessageHandlingException: nested exception is + org.springframework.messaging.MessagingException: has an error, failedMessage=GenericMessage [payload=byte[15], + headers={amqp_receivedDeliveryMode=NON_PERSISTENT, amqp_receivedRoutingKey=input.hello, amqp_deliveryTag=1, + deliveryAttempt=3, amqp_consumerQueue=input.hello, amqp_redelivered=false, id=a15231e6-3f80-677b-5ad7-d4b1e61e486e, + amqp_consumerTag=amq.ctag-skBFapilvtZhDsn0k3ZmQg, contentType=application/json, timestamp=1522327846136}] + at org.spring...integ...han...MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:107) + at. . . . . +Payload {"name”:"Bob"} +---- + +This effectively combines application-level and system-level error handling to further assist with downstream troubleshooting mechanics. + +===== Re-queue Failed Messages + +As mentioned earlier, the currently supported binders (Rabbit and Kafka) rely on `RetryTemplate` to facilitate successful message processing. See <> for details. +However, for cases when `max-attempts` property is set to 1, internal reprocessing of the message is disabled. At this point, you can facilitate message re-processing (re-tries) +by instructing the messaging system to re-queue the failed message. Once re-queued, the failed message is sent back to the original handler, essentially creating a retry loop. + +This option may be feasible for cases where the nature of the error is related to some sporadic yet short-term unavailability of some resource. + +To accomplish that, you must set the following properties: + +[source,text] +---- +spring.cloud.stream.bindings.input.consumer.max-attempts=1 +spring.cloud.stream.rabbit.bindings.input.consumer.requeue-rejected=true +---- + +In the preceding example, the `max-attempts` set to 1 essentially disabling internal re-tries and `requeue-rejected` (short for _requeue rejected messages_) is set to `true`. +Once set, the failed message is resubmitted to the same handler and loops continuously or until the handler throws `AmqpRejectAndDontRequeueException` +essentially allowing you to build your own re-try logic within the handler itself. + +==== Retry Template + +The `RetryTemplate` is part of the https://github.com/spring-projects/spring-retry[Spring Retry] library. +While it is out of scope of this document to cover all of the capabilities of the `RetryTemplate`, we will mention the following consumer properties that are specifically related to +the `RetryTemplate`: + +maxAttempts:: +The number of attempts to process the message. ++ +Default: 3. +backOffInitialInterval:: +The backoff initial interval on retry. ++ +Default 1000 milliseconds. +backOffMaxInterval:: +The maximum backoff interval. ++ +Default 10000 milliseconds. +backOffMultiplier:: +The backoff multiplier. ++ +Default 2.0. +defaultRetryable:: +Whether exceptions thrown by the listener that are not listed in the `retryableExceptions` are retryable. ++ +Default: `true`. +retryableExceptions:: +A map of Throwable class names in the key and a boolean in the value. +Specify those exceptions (and subclasses) that will or won't be retried. +Also see `defaultRetriable`. +Example: `spring.cloud.stream.bindings.input.consumer.retryable-exceptions.java.lang.IllegalStateException=false`. ++ +Default: empty. + +While the preceding settings are sufficient for majority of the customization requirements, they may not satisfy certain complex requirements at, which +point you may want to provide your own instance of the `RetryTemplate`. To do so configure it as a bean in your application configuration. The application provided +instance will override the one provided by the framework. Also, to avoid conflicts you must qualify the instance of the `RetryTemplate` you want to be used by the binder +as `@StreamRetryTemplate`. For example, + +[source,java] +---- +@StreamRetryTemplate +public RetryTemplate myRetryTemplate() { + return new RetryTemplate(); +} +---- +As you can see from the above example you don't need to annotate it with `@Bean` since `@StreamRetryTemplate` is a qualified `@Bean`. + +[[spring-cloud-stream-overview-reactive-programming-support]] +=== Reactive Programming Support + +Spring Cloud Stream also supports the use of reactive APIs where incoming and outgoing data is handled as continuous data flows. +Support for reactive APIs is available through `spring-cloud-stream-reactive`, which needs to be added explicitly to your project. + +The programming model with reactive APIs is declarative. Instead of specifying how each individual message should be handled, you can use operators that describe functional transformations from inbound to outbound data flows. + +At present Spring Cloud Stream supports the only the https://projectreactor.io/[Reactor API]. +In the future, we intend to support a more generic model based on Reactive Streams. + +The reactive programming model also uses the `@StreamListener` annotation for setting up reactive handlers. +The differences are that: + +* The `@StreamListener` annotation must not specify an input or output, as they are provided as arguments and return values from the method. +* The arguments of the method must be annotated with `@Input` and `@Output`, indicating which input or output the incoming and outgoing data flows connect to, respectively. +* The return value of the method, if any, is annotated with `@Output`, indicating the input where data should be sent. + +NOTE: Reactive programming support requires Java 1.8. + +NOTE: As of Spring Cloud Stream 1.1.1 and later (starting with release train Brooklyn.SR2), reactive programming support requires the use of Reactor 3.0.4.RELEASE and higher. +Earlier Reactor versions (including 3.0.1.RELEASE, 3.0.2.RELEASE and 3.0.3.RELEASE) are not supported. +`spring-cloud-stream-reactive` transitively retrieves the proper version, but it is possible for the project structure to manage the version of the `io.projectreactor:reactor-core` to an earlier release, especially when using Maven. +This is the case for projects generated by using Spring Initializr with Spring Boot 1.x, which overrides the Reactor version to `2.0.8.RELEASE`. +In such cases, you must ensure that the proper version of the artifact is released. +You can do so by adding a direct dependency on `io.projectreactor:reactor-core` with a version of `3.0.4.RELEASE` or later to your project. + +NOTE: The use of term, "`reactive`", currently refers to the reactive APIs being used and not to the execution model being reactive (that is, the bound endpoints still use a 'push' rather than a 'pull' model). While some backpressure support is provided by the use of Reactor, we do intend, in a future release, to support entirely reactive pipelines by the use of native reactive clients for the connected middleware. + +===== Reactor-based Handlers + +A Reactor-based handler can have the following argument types: + +* For arguments annotated with `@Input`, it supports the Reactor `Flux` type. +The parameterization of the inbound Flux follows the same rules as in the case of individual message handling: It can be the entire `Message`, a POJO that can be the `Message` payload, or a POJO that is the result of a transformation based on the `Message` content-type header. Multiple inputs are provided. +* For arguments annotated with `Output`, it supports the `FluxSender` type, which connects a `Flux` produced by the method with an output. Generally speaking, specifying outputs as arguments is only recommended when the method can have multiple outputs. + +A Reactor-based handler supports a return type of `Flux`. In that case, it must be annotated with `@Output`. We recommend using the return value of the method when a single output `Flux` is available. + +The following example shows a Reactor-based `Processor`: + +[source, java] +---- +@EnableBinding(Processor.class) +@EnableAutoConfiguration +public static class UppercaseTransformer { + + @StreamListener + @Output(Processor.OUTPUT) + public Flux receive(@Input(Processor.INPUT) Flux input) { + return input.map(s -> s.toUpperCase()); + } +} +---- + +The same processor using output arguments looks like the following example: + +[source, java] +---- +@EnableBinding(Processor.class) +@EnableAutoConfiguration +public static class UppercaseTransformer { + + @StreamListener + public void receive(@Input(Processor.INPUT) Flux input, + @Output(Processor.OUTPUT) FluxSender output) { + output.send(input.map(s -> s.toUpperCase())); + } +} +---- + +===== Reactive Sources + +Spring Cloud Stream reactive support also provides the ability for creating reactive sources through the `@StreamEmitter` annotation. +By using the `@StreamEmitter` annotation, a regular source may be converted to a reactive one. +`@StreamEmitter` is a method level annotation that marks a method to be an emitter to outputs declared with `@EnableBinding`. +You cannot use the `@Input` annotation along with `@StreamEmitter`, as the methods marked with this annotation are not listening for any input. Rather, methods marked with `@StreamEmitter` generate output. +Following the same programming model used in `@StreamListener`, `@StreamEmitter` also allows flexible ways of using the `@Output` annotation, depending on whether the method has any arguments, a return type, and other considerations. + +The remainder of this section contains examples of using the `@StreamEmitter` annotation in various styles. + +The following example emits the `Hello, World` message every millisecond and publishes to a Reactor `Flux`: + +[source, java] +---- +@EnableBinding(Source.class) +@EnableAutoConfiguration +public static class HelloWorldEmitter { + + @StreamEmitter + @Output(Source.OUTPUT) + public Flux emit() { + return Flux.intervalMillis(1) + .map(l -> "Hello World"); + } +} +---- + +In the preceding example, the resulting messages in the `Flux` are sent to the output channel of the `Source`. + +The next example is another flavor of an `@StreamEmmitter` that sends a Reactor `Flux`. +Instead of returning a `Flux`, the following method uses a `FluxSender` to programmatically send a `Flux` from a source: + +[source, java] +---- +@EnableBinding(Source.class) +@EnableAutoConfiguration +public static class HelloWorldEmitter { + + @StreamEmitter + @Output(Source.OUTPUT) + public void emit(FluxSender output) { + output.send(Flux.intervalMillis(1) + .map(l -> "Hello World")); + } +} +---- + +The next example is exactly same as the above snippet in functionality and style. +However, instead of using an explicit `@Output` annotation on the method, it uses the annotation on the method parameter. + +[source, java] +---- +@EnableBinding(Source.class) +@EnableAutoConfiguration +public static class HelloWorldEmitter { + + @StreamEmitter + public void emit(@Output(Source.OUTPUT) FluxSender output) { + output.send(Flux.intervalMillis(1) + .map(l -> "Hello World")); + } +} +---- + +The last example in this section is yet another flavor of writing reacting sources by using the Reactive Streams Publisher API and taking advantage of the support for it in https://github.com/spring-projects/spring-integration-java-dsl/wiki/Spring-Integration-Java-DSL-Reference[Spring Integration Java DSL]. +The `Publisher` in the following example still uses Reactor `Flux` under the hood, but, from an application perspective, that is transparent to the user and only needs Reactive Streams and Java DSL for Spring Integration: + +[source, java] +---- +@EnableBinding(Source.class) +@EnableAutoConfiguration +public static class HelloWorldEmitter { + + @StreamEmitter + @Output(Source.OUTPUT) + @Bean + public Publisher> emit() { + return IntegrationFlows.from(() -> + new GenericMessage<>("Hello World"), + e -> e.poller(p -> p.fixedDelay(1))) + .toReactivePublisher(); + } +} +---- + +[[spring-cloud-stream-overview-binders]] +== Binders + +Spring Cloud Stream provides a Binder abstraction for use in connecting to physical destinations at the external middleware. +This section provides information about the main concepts behind the Binder SPI, its main components, and implementation-specific details. + +=== Producers and Consumers + +The following image shows the general relationship of producers and consumers: + +.Producers and Consumers +image::producers-consumers.png[width=800,scaledwidth="75%",align="center"] + +A producer is any component that sends messages to a channel. +The channel can be bound to an external message broker with a `Binder` implementation for that broker. +When invoking the `bindProducer()` method, the first parameter is the name of the destination within the broker, the second parameter is the local channel instance to which the producer sends messages, and the third parameter contains properties (such as a partition key expression) to be used within the adapter that is created for that channel. + +A consumer is any component that receives messages from a channel. +As with a producer, the consumer's channel can be bound to an external message broker. +When invoking the `bindConsumer()` method, the first parameter is the destination name, and a second parameter provides the name of a logical group of consumers. +Each group that is represented by consumer bindings for a given destination receives a copy of each message that a producer sends to that destination (that is, it follows normal publish-subscribe semantics). +If there are multiple consumer instances bound with the same group name, then messages are load-balanced across those consumer instances so that each message sent by a producer is consumed by only a single consumer instance within each group (that is, it follows normal queueing semantics). + +[[spring-cloud-stream-overview-binder-api]] +=== Binder SPI + +The Binder SPI consists of a number of interfaces, out-of-the box utility classes, and discovery strategies that provide a pluggable mechanism for connecting to external middleware. + +The key point of the SPI is the `Binder` interface, which is a strategy for connecting inputs and outputs to external middleware. The following listing shows the definnition of the `Binder` interface: + +[source,java] +---- +public interface Binder { + Binding bindConsumer(String name, String group, T inboundBindTarget, C consumerProperties); + + Binding bindProducer(String name, T outboundBindTarget, P producerProperties); +} +---- + +The interface is parameterized, offering a number of extension points: + +* Input and output bind targets. As of version 1.0, only `MessageChannel` is supported, but this is intended to be used as an extension point in the future. +* Extended consumer and producer properties, allowing specific Binder implementations to add supplemental properties that can be supported in a type-safe manner. + +A typical binder implementation consists of the following: + +* A class that implements the `Binder` interface; +* A Spring `@Configuration` class that creates a bean of type `Binder` along with the middleware connection infrastructure. +* A `META-INF/spring.binders` file found on the classpath containing one or more binder definitions, as shown in the following example: ++ +[source] +---- +kafka:\ +org.springframework.cloud.stream.binder.kafka.config.KafkaBinderConfiguration +---- + +=== Binder Detection + +Spring Cloud Stream relies on implementations of the Binder SPI to perform the task of connecting channels to message brokers. +Each Binder implementation typically connects to one type of messaging system. + +==== Classpath Detection + +By default, Spring Cloud Stream relies on Spring Boot's auto-configuration to configure the binding process. +If a single Binder implementation is found on the classpath, Spring Cloud Stream automatically uses it. +For example, a Spring Cloud Stream project that aims to bind only to RabbitMQ can add the following dependency: + +[source,xml] +---- + + org.springframework.cloud + spring-cloud-stream-binder-rabbit + +---- + +For the specific Maven coordinates of other binder dependencies, see the documentation of that binder implementation. + +[[multiple-binders]] +=== Multiple Binders on the Classpath + +When multiple binders are present on the classpath, the application must indicate which binder is to be used for each channel binding. +Each binder configuration contains a `META-INF/spring.binders` file, which is a simple properties file, as shown in the following example: + +[source] +---- +rabbit:\ +org.springframework.cloud.stream.binder.rabbit.config.RabbitServiceAutoConfiguration +---- + +Similar files exist for the other provided binder implementations (such as Kafka), and custom binder implementations are expected to provide them as well. +The key represents an identifying name for the binder implementation, whereas the value is a comma-separated list of configuration classes that each contain one and only one bean definition of type `org.springframework.cloud.stream.binder.Binder`. + +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 channel binding. +For instance, a processor application (that has channels named `input` and `output` for read and write respectively) that reads from Kafka and writes to RabbitMQ can specify the following configuration: + +[source] +---- +spring.cloud.stream.bindings.input.binder=kafka +spring.cloud.stream.bindings.output.binder=rabbit +---- + +[[multiple-systems]] +=== Connecting to Multiple Systems + +By default, binders share the application's Spring Boot auto-configuration, so that one instance of each binder found on the classpath is created. +If your application should connect to more than one broker of the same type, you can specify multiple binder configurations, each with different environment settings. + +NOTE: Turning on explicit binder configuration disables the default binder configuration process altogether. +If you do so, all binders in use must be included in the configuration. +Frameworks that intend to use Spring Cloud Stream transparently may create binder configurations that can be referenced by name, but they do not affect the default binder configuration. +In order to do so, a binder configuration may have its `defaultCandidate` flag set to false (for example, `spring.cloud.stream.binders..defaultCandidate=false`). +This denotes a configuration that exists independently of the default binder configuration process. + +The following example shows a typical configuration for a processor application that connects to two RabbitMQ broker instances: + +[source,yml] +---- +spring: + cloud: + stream: + bindings: + input: + destination: thing1 + binder: rabbit1 + output: + destination: thing2 + binder: rabbit2 + binders: + rabbit1: + type: rabbit + environment: + spring: + rabbitmq: + host: + rabbit2: + type: rabbit + environment: + spring: + rabbitmq: + host: +---- + +=== Binding visualization and control +Since version 2.0, Spring Cloud Stream supports visualization and control of the Bindings through Actuator endpoints. + +Starting with version 2.0 actuator and web are optional, you must first add one of the web dependencies as well as add the actuator dependency manually. +The following example shows how to add the dependency for the Web framework: + +[source,xml] +---- + + org.springframework.boot + spring-boot-starter-web + +---- + +The following example shows how to add the dependency for the WebFlux framework: + +[source,xml] +---- + + org.springframework.boot + spring-boot-starter-webflux + +---- + +You can add the Actuator dependency as follows: +[source,xml] +---- + + org.springframework.boot + spring-boot-starter-actuator + +---- + +NOTE: To run Spring Cloud Stream 2.0 apps in Cloud Foundry, you must add `spring-boot-starter-web` and `spring-boot-starter-actuator` to the classpath. Otherwise, the +application will not start due to health check failures. + +You must also enable the `bindings` actuator endpoints by setting the following property: `--management.endpoints.web.exposure.include=bindings`. + +Once those prerequisites are satisfied. you should see the following in the logs when application start: + + : Mapped "{[/actuator/bindings/{name}],methods=[POST]. . . + : Mapped "{[/actuator/bindings],methods=[GET]. . . + : Mapped "{[/actuator/bindings/{name}],methods=[GET]. . . + +To visualize the current bindings, access the following URL: +`http://:/actuator/bindings` + +Alternative, to see a single binding, access one of the URLs similar to the following: +`http://:/actuator/bindings/myBindingName` + +You can also stop, start, pause, and resume individual bindings by posting to the same URL while providing a `state` argument as JSON, as shown in the following examples: + +curl -d '{"state":"STOPPED"}' -H "Content-Type: application/json" -X POST http://:/actuator/bindings/myBindingName +curl -d '{"state":"STARTED"}' -H "Content-Type: application/json" -X POST http://:/actuator/bindings/myBindingName +curl -d '{"state":"PAUSED"}' -H "Content-Type: application/json" -X POST http://:/actuator/bindings/myBindingName +curl -d '{"state":"RESUMED"}' -H "Content-Type: application/json" -X POST http://:/actuator/bindings/myBindingName + +NOTE: `PAUSED` and `RESUMED` work only when the corresponding binder and its underlying technology supports it. Otherwise, you see the warning message in the logs. +Currently, only Kafka binder supports the `PAUSED` and `RESUMED` states. + +=== Binder Configuration Properties + +The following properties are available when customizing binder configurations. These properties exposed via `org.springframework.cloud.stream.config.BinderProperties` + +They must be prefixed with `spring.cloud.stream.binders.`. + +type:: +The binder type. +It typically references one of the binders found on the classpath -- in particular, a key in a `META-INF/spring.binders` file. ++ +By default, it has the same value as the configuration name. +inheritEnvironment:: +Whether the configuration inherits the environment of the application itself. ++ +Default: `true`. +environment:: +Root for a set of properties that can be used to customize the environment of the binder. +When this property is set, the context in which the binder is being created is not a child of the application context. +This setting allows for complete separation between the binder components and the application components. ++ +Default: `empty`. +defaultCandidate:: +Whether the binder configuration is a candidate for being considered a default binder or can be used only when explicitly referenced. +This setting allows adding binder configurations without interfering with the default processing. ++ +Default: `true`. + +== Configuration Options + +Spring Cloud Stream supports general configuration options as well as configuration for bindings and binders. +Some binders let additional binding properties support middleware-specific features. + +Configuration options can be provided to Spring Cloud Stream applications through any mechanism supported by Spring Boot. +This includes application arguments, environment variables, and YAML or .properties files. + +=== Binding Service Properties + +These properties are exposed via `org.springframework.cloud.stream.config.BindingServiceProperties` + +spring.cloud.stream.instanceCount:: +The number of deployed instances of an application. +Must be set for partitioning on the producer side. Must be set on the consumer side when using RabbitMQ and with Kafka if `autoRebalanceEnabled=false`. ++ +Default: `1`. + +spring.cloud.stream.instanceIndex:: +The instance index of the application: A number from `0` to `instanceCount - 1`. +Used for partitioning with RabbitMQ and with Kafka if `autoRebalanceEnabled=false`. +Automatically set in Cloud Foundry to match the application's instance index. + +spring.cloud.stream.dynamicDestinations:: +A list of destinations that can be bound dynamically (for example, in a dynamic routing scenario). +If set, only listed destinations can be bound. ++ +Default: empty (letting any destination be bound). + +spring.cloud.stream.defaultBinder:: +The default binder to use, if multiple binders are configured. +See <>. ++ +Default: empty. + +spring.cloud.stream.overrideCloudConnectors:: +This property is only applicable when the `cloud` profile is active and Spring Cloud Connectors are provided with the application. +If the property is `false` (the default), the binder detects a suitable bound service (for example, a RabbitMQ service bound in Cloud Foundry for the RabbitMQ binder) and uses it for creating connections (usually through Spring Cloud Connectors). +When set to `true`, this property instructs binders to completely ignore the bound services and rely on Spring Boot properties (for example, relying on the `spring.rabbitmq.*` properties provided in the environment for the RabbitMQ binder). +The typical usage of this property is to be nested in a customized environment <>. ++ +Default: `false`. + +spring.cloud.stream.bindingRetryInterval:: +The interval (in seconds) between retrying binding creation when, for example, the binder does not support late binding and the broker (for example, Apache Kafka) is down. +Set it to zero to treat such conditions as fatal, preventing the application from starting. ++ +Default: `30` + +[[binding-properties]] +=== Binding Properties + +Binding properties are supplied by using the format of `spring.cloud.stream.bindings..=`. +The `` represents the name of the channel being configured (for example, `output` for a `Source`). + +To avoid repetition, Spring Cloud Stream supports setting values for all channels, in the format of `spring.cloud.stream.default.=`. + +When it comes to avoiding repetitions for extended binding properties, this format should be used - `spring.cloud.stream..default..=`. + +In what follows, we indicate where we have omitted the `spring.cloud.stream.bindings..` prefix and focus just on the property name, with the understanding that the prefix ise included at runtime. + +==== Common Binding Properties + +These properties are exposed via `org.springframework.cloud.stream.config.BindingProperties` + +The following binding properties are available for both input and output bindings and must be prefixed with `spring.cloud.stream.bindings..` (for example, `spring.cloud.stream.bindings.input.destination=ticktock`). + +Default values can be set by using the `spring.cloud.stream.default` prefix (for example`spring.cloud.stream.default.contentType=application/json`). + +destination:: +The target destination of a channel on the bound middleware (for example, the RabbitMQ exchange or Kafka topic). +If the channel is bound as a consumer, it could be bound to multiple destinations, and the destination names can be specified as comma-separated `String` values. +If not set, the channel name is used instead. +The default value of this property cannot be overridden. +group:: +The consumer group of the channel. +Applies only to inbound bindings. +See <>. ++ +Default: `null` (indicating an anonymous consumer). +contentType:: +The content type of the channel. +See "`<>`". ++ +Default: `application/json`. +binder:: +The binder used by this binding. +See "`<>`" for details. ++ +Default: `null` (the default binder is used, if it exists). + +==== Consumer Properties + +These properties are exposed via `org.springframework.cloud.stream.binder.ConsumerProperties` + +The following binding properties are available for input bindings only and must be prefixed with `spring.cloud.stream.bindings..consumer.` (for example, `spring.cloud.stream.bindings.input.consumer.concurrency=3`). + +Default values can be set by using the `spring.cloud.stream.default.consumer` prefix (for example, `spring.cloud.stream.default.consumer.headerMode=none`). + +concurrency:: +The concurrency of the inbound consumer. ++ +Default: `1`. +partitioned:: +Whether the consumer receives data from a partitioned producer. ++ +Default: `false`. +headerMode:: +When set to `none`, disables header parsing on input. +Effective only for messaging middleware that does not support message headers natively and requires header embedding. +This option is useful when consuming data from non-Spring Cloud Stream applications when native headers are not supported. +When set to `headers`, it uses the middleware's native header mechanism. +When set to `embeddedHeaders`, it embeds headers into the message payload. ++ +Default: depends on the binder implementation. +maxAttempts:: +If processing fails, the number of attempts to process the message (including the first). +Set to `1` to disable retry. ++ +Default: `3`. +backOffInitialInterval:: +The backoff initial interval on retry. ++ +Default: `1000`. +backOffMaxInterval:: +The maximum backoff interval. ++ +Default: `10000`. +backOffMultiplier:: +The backoff multiplier. ++ +Default: `2.0`. +defaultRetryable:: +Whether exceptions thrown by the listener that are not listed in the `retryableExceptions` are retryable. ++ +Default: `true`. +instanceIndex:: +When set to a value greater than equal to zero, it allows customizing the instance index of this consumer (if different from `spring.cloud.stream.instanceIndex`). +When set to a negative value, it defaults to `spring.cloud.stream.instanceIndex`. +See "`<>`" for more information. ++ +Default: `-1`. +instanceCount:: +When set to a value greater than equal to zero, it allows customizing the instance count of this consumer (if different from `spring.cloud.stream.instanceCount`). +When set to a negative value, it defaults to `spring.cloud.stream.instanceCount`. +See "`<>`" for more information. ++ +Default: `-1`. +retryableExceptions:: +A map of Throwable class names in the key and a boolean in the value. +Specify those exceptions (and subclasses) that will or won't be retried. +Also see `defaultRetriable`. +Example: `spring.cloud.stream.bindings.input.consumer.retryable-exceptions.java.lang.IllegalStateException=false`. ++ +Default: empty. +useNativeDecoding:: +When set to `true`, the inbound message is deserialized directly by the client library, which must be configured correspondingly (for example, setting an appropriate Kafka producer value deserializer). +When this configuration is being used, the inbound message unmarshalling is not based on the `contentType` of the binding. +When native decoding is used, it is the responsibility of the producer to use an appropriate encoder (for example, the Kafka producer value serializer) to serialize the outbound message. +Also, when native encoding and decoding is used, the `headerMode=embeddedHeaders` property is ignored and headers are not embedded in the message. +See the producer property `useNativeEncoding`. ++ +Default: `false`. + + +==== Producer Properties + +These properties are exposed via `org.springframework.cloud.stream.binder.ProducerProperties` + +The following binding properties are available for output bindings only and must be prefixed with `spring.cloud.stream.bindings..producer.` (for example, `spring.cloud.stream.bindings.input.producer.partitionKeyExpression=payload.id`). + +Default values can be set by using the prefix `spring.cloud.stream.default.producer` (for example, `spring.cloud.stream.default.producer.partitionKeyExpression=payload.id`). + +partitionKeyExpression:: +A SpEL expression that determines how to partition outbound data. +If set, or if `partitionKeyExtractorClass` is set, outbound data on this channel is partitioned. `partitionCount` must be set to a value greater than 1 to be effective. +Mutually exclusive with `partitionKeyExtractorClass`. +See "`<>`". ++ +Default: null. +partitionKeyExtractorClass:: +A `PartitionKeyExtractorStrategy` implementation. +If set, or if `partitionKeyExpression` is set, outbound data on this channel is partitioned. `partitionCount` must be set to a value greater than 1 to be effective. +Mutually exclusive with `partitionKeyExpression`. +See "`<>`". ++ +Default: `null`. +partitionSelectorClass:: + A `PartitionSelectorStrategy` implementation. +Mutually exclusive with `partitionSelectorExpression`. +If neither is set, the partition is selected as the `hashCode(key) % partitionCount`, where `key` is computed through either `partitionKeyExpression` or `partitionKeyExtractorClass`. ++ +Default: `null`. +partitionSelectorExpression:: +A SpEL expression for customizing partition selection. +Mutually exclusive with `partitionSelectorClass`. +If neither is set, the partition is selected as the `hashCode(key) % partitionCount`, where `key` is computed through either `partitionKeyExpression` or `partitionKeyExtractorClass`. ++ +Default: `null`. +partitionCount:: +The number of target partitions for the data, if partitioning is enabled. +Must be set to a value greater than 1 if the producer is partitioned. +On Kafka, it is interpreted as a hint. The larger of this and the partition count of the target topic is used instead. ++ +Default: `1`. +requiredGroups:: +A comma-separated list of groups to which the producer must ensure message delivery even if they start after it has been created (for example, by pre-creating durable queues in RabbitMQ). +headerMode:: +When set to `none`, it disables header embedding on output. +It is effective only for messaging middleware that does not support message headers natively and requires header embedding. +This option is useful when producing data for non-Spring Cloud Stream applications when native headers are not supported. +When set to `headers`, it uses the middleware's native header mechanism. +When set to `embeddedHeaders`, it embeds headers into the message payload. ++ +Default: Depends on the binder implementation. +useNativeEncoding:: +When set to `true`, the outbound message is serialized directly by the client library, which must be configured correspondingly (for example, setting an appropriate Kafka producer value serializer). +When this configuration is being used, the outbound message marshalling is not based on the `contentType` of the binding. +When native encoding is used, it is the responsibility of the consumer to use an appropriate decoder (for example, the Kafka consumer value de-serializer) to deserialize the inbound message. +Also, when native encoding and decoding is used, the `headerMode=embeddedHeaders` property is ignored and headers are not embedded in the message. +See the consumer property `useNativeDecoding`. ++ +Default: `false`. +errorChannelEnabled:: +When set to `true`, if the binder supports asynchroous send results, send failures are sent to an error channel for the destination. +See "`<>`" for more information. ++ +Default: `false`. + +[[dynamicdestination]] +=== Using Dynamically Bound Destinations + +Besides the channels defined by using `@EnableBinding`, Spring Cloud Stream lets applications send messages to dynamically bound destinations. +This is useful, for example, when the target destination needs to be determined at runtime. +Applications can do so by using the `BinderAwareChannelResolver` bean, registered automatically by the `@EnableBinding` annotation. + +The 'spring.cloud.stream.dynamicDestinations' property can be used for restricting the dynamic destination names to a known set (whitelisting). +If this property is not set, any destination can be bound dynamically. + +The `BinderAwareChannelResolver` can be used directly, as shown in the following example of a REST controller using a path variable to decide the target channel: + +[source,java] +---- +@EnableBinding +@Controller +public class SourceWithDynamicDestination { + + @Autowired + private BinderAwareChannelResolver resolver; + + @RequestMapping(path = "/{target}", method = POST, consumes = "*/*") + @ResponseStatus(HttpStatus.ACCEPTED) + public void handleRequest(@RequestBody String body, @PathVariable("target") target, + @RequestHeader(HttpHeaders.CONTENT_TYPE) Object contentType) { + sendMessage(body, target, contentType); + } + + private void sendMessage(String body, String target, Object contentType) { + resolver.resolveDestination(target).send(MessageBuilder.createMessage(body, + new MessageHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE, contentType)))); + } +} +---- + +Now consider what happens when we start the application on the default port (8080) and make the following requests with CURL: + +---- +curl -H "Content-Type: application/json" -X POST -d "customer-1" http://localhost:8080/customers + +curl -H "Content-Type: application/json" -X POST -d "order-1" http://localhost:8080/orders +---- + +The destinations, 'customers' and 'orders', are created in the broker (in the exchange for Rabbit or in the topic for Kafka) with names of 'customers' and 'orders', and the data is published to the appropriate destinations. + +The `BinderAwareChannelResolver` is a general-purpose Spring Integration `DestinationResolver` and can be injected in other components -- for example, in a router using a SpEL expression based on the `target` field of an incoming JSON message. The following example includes a router that reads SpEL expressions: + +[source,java] +---- +@EnableBinding +@Controller +public class SourceWithDynamicDestination { + + @Autowired + private BinderAwareChannelResolver resolver; + + + @RequestMapping(path = "/", method = POST, consumes = "application/json") + @ResponseStatus(HttpStatus.ACCEPTED) + public void handleRequest(@RequestBody String body, @RequestHeader(HttpHeaders.CONTENT_TYPE) Object contentType) { + sendMessage(body, contentType); + } + + private void sendMessage(Object body, Object contentType) { + routerChannel().send(MessageBuilder.createMessage(body, + new MessageHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE, contentType)))); + } + + @Bean(name = "routerChannel") + public MessageChannel routerChannel() { + return new DirectChannel(); + } + + @Bean + @ServiceActivator(inputChannel = "routerChannel") + public ExpressionEvaluatingRouter router() { + ExpressionEvaluatingRouter router = + new ExpressionEvaluatingRouter(new SpelExpressionParser().parseExpression("payload.target")); + router.setDefaultOutputChannelName("default-output"); + router.setChannelResolver(resolver); + return router; + } +} +---- + +The https://github.com/spring-cloud-stream-app-starters/router[Router Sink Application] uses this technique to create the destinations on-demand. + +If the channel names are known in advance, you can configure the producer properties as with any other destination. +Alternatively, if you register a `NewDestinationBindingCallback<>` bean, it is invoked just before the binding is created. +The callback takes the generic type of the extended producer properties used by the binder. +It has one method: + +[source, java] +---- +void configure(String channelName, MessageChannel channel, ProducerProperties producerProperties, + T extendedProducerProperties); +---- + +The following example shows how to use the RabbitMQ binder: + +[source, java] +---- +@Bean +public NewDestinationBindingCallback dynamicConfigurer() { + return (name, channel, props, extended) -> { + props.setRequiredGroups("bindThisQueue"); + extended.setQueueNameGroupOnly(true); + extended.setAutoBindDlq(true); + extended.setDeadLetterQueueName("myDLQ"); + }; +} +---- + +NOTE: If you need to support dynamic destinations with multiple binder types, use `Object` for the generic type and cast the `extended` argument as needed. + +[[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 +is represented as a Spring `Message`, a message may have to be transformed to a desired shape or size before reaching its destination. This is required for two reasons: + +. To convert the contents of the incoming message to match the signature of the application-provided handler. + +. To convert the contents of the outgoing message to the wire format. + +The wire format is typically `byte[]` (that is true for the Kafka and Rabbit binders), but it is governed by the binder implementation. + +In Spring Cloud Stream, message transformation is accomplished with an `org.springframework.messaging.converter.MessageConverter`. + +NOTE: As a supplement to the details to follow, you may also want to read the following https://spring.io/blog/2018/02/26/spring-cloud-stream-2-0-content-type-negotiation-and-transformation[blog post]. + +=== Mechanics + +To better understand the mechanics and the necessity behind content-type negotiation, we take a look at a very simple use case by using the following message handler as an example: + +[source, java] +---- +@StreamListener(Processor.INPUT) +@SendTo(Processor.OUTPUT) +public String handle(Person person) {..} +---- + +NOTE: For simplicity, we assume that this is the only handler in the application (we assume there is no internal pipeline). + +The handler shown in the preceding example expects a `Person` object as an argument and produces a `String` type as an output. +In order for the framework to succeed in passing the incoming `Message` as an argument to this handler, it has to somehow transform the payload of the `Message` type from the wire format to a `Person` type. +In other words, the framework must locate and apply the appropriate `MessageConverter`. +To accomplish that, the framework needs some instructions from the user. +One of these instructions is already provided by the signature of the handler method itself (`Person` type). +Consequently, in theory, that should be (and, in some cases, is) enough. +However, for the majority of use cases, in order to select the appropriate `MessageConverter`, the framework needs an additional piece of information. +That missing piece is `contentType`. + +Spring Cloud Stream provides three mechanisms to define `contentType` (in order of precedence): + +. *HEADER*: The `contentType` can be communicated through the Message itself. By providing a `contentType` header, you declare the content type to use to locate and apply the appropriate `MessageConverter`. + +. *BINDING*: The `contentType` can be set per destination binding by setting the `spring.cloud.stream.bindings.input.content-type` property. ++ +NOTE: The `input` segment in the property name corresponds to the actual name of the destination (which is “input” in our case). This approach lets you declare, on a per-binding basis, the content type to use to locate and apply the appropriate `MessageConverter`. + +. *DEFAULT*: If `contentType` is not present in the `Message` header or the binding, the default `application/json` content type is used to +locate and apply the appropriate `MessageConverter`. + +As mentioned earlier, the preceding list also demonstrates the order of precedence in case of a tie. For example, a header-provided content type takes precedence over any other content type. +The same applies for a content type set on a per-binding basis, which essentially lets you override the default content type. +However, it also provides a sensible default (which was determined from community feedback). + +Another reason for making `application/json` the default stems from the interoperability requirements driven by distributed microservices architectures, where producer and consumer not only run in different JVMs but can also run on different non-JVM platforms. + +When the non-void handler method returns, if the the return value is already a `Message`, that `Message` becomes the payload. However, when the return value is not a `Message`, the new `Message` is constructed with the return value as the payload while inheriting +headers from the input `Message` minus the headers defined or filtered by `SpringIntegrationProperties.messageHandlerNotPropagatedHeaders`. +By default, there is only one header set there: `contentType`. This means that the new `Message` does not have `contentType` header set, thus ensuring that the `contentType` can evolve. +You can always opt out of returning a `Message` from the handler method where you can inject any header you wish. + +If there is an internal pipeline, the `Message` is sent to the next handler by going through the same process of conversion. However, if there is no internal pipeline or you have reached the end of it, the `Message` is sent back to the output destination. + +==== Content Type versus Argument Type + +As mentioned earlier, for the framework to select the appropriate `MessageConverter`, it requires argument type and, optionally, content type information. +The logic for selecting the appropriate `MessageConverter` resides with the argument resolvers (`HandlerMethodArgumentResolvers`), which trigger right before the invocation of the user-defined handler method (which is when the actual argument type is known to the framework). +If the argument type does not match the type of the current payload, the framework delegates to the stack of the +pre-configured `MessageConverters` to see if any one of them can convert the payload. +As you can see, the `Object fromMessage(Message message, Class targetClass);` +operation of the MessageConverter takes `targetClass` as one of its arguments. +The framework also ensures that the provided `Message` always contains a `contentType` header. +When no contentType header was already present, it injects either the per-binding `contentType` header or the default `contentType` header. +The combination of `contentType` argument type is the mechanism by which framework determines if message can be converted to a target type. +If no appropriate `MessageConverter` is found, an exception is thrown, which you can handle by adding a custom `MessageConverter` (see "`<>`"). + +But what if the payload type matches the target type declared by the handler method? In this case, there is nothing to convert, and the +payload is passed unmodified. While this sounds pretty straightforward and logical, keep in mind handler methods that take a `Message` or `Object` as an argument. +By declaring the target type to be `Object` (which is an `instanceof` everything in Java), you essentially forfeit the conversion process. + +NOTE: Do not expect `Message` to be converted into some other type based only on the `contentType`. +Remember that the `contentType` is complementary to the target type. +If you wish, you can provide a hint, which `MessageConverter` may or may not take into consideration. + +==== Message Converters + +`MessageConverters` define two methods: + +[source, java] +---- +Object fromMessage(Message message, Class targetClass); + +Message toMessage(Object payload, @Nullable MessageHeaders headers); +---- + +It is important to understand the contract of these methods and their usage, specifically in the context of Spring Cloud Stream. + +The `fromMessage` method converts an incoming `Message` to an argument type. +The payload of the `Message` could be any type, and it is +up to the actual implementation of the `MessageConverter` to support multiple types. +For example, some JSON converter may support the payload type as `byte[]`, `String`, and others. +This is important when the application contains an internal pipeline (that is, input -> handler1 -> handler2 ->. . . -> output) and the output of the upstream handler results in a `Message` which may not be in the initial wire format. + +However, the `toMessage` method has a more strict contract and must always convert `Message` to the wire format: `byte[]`. + +So, for all intents and purposes (and especially when implementing your own converter) you regard the two methods as having the following signatures: + +[source, java] +---- +Object fromMessage(Message message, Class targetClass); + +Message toMessage(Object payload, @Nullable MessageHeaders headers); +---- + +=== Provided MessageConverters + +As mentioned earlier, the framework already provides a stack of `MessageConverters` to handle most common use cases. +The following list describes the provided `MessageConverters`, in order of precedence (the first `MessageConverter` that works is used): + +. `ApplicationJsonMessageMarshallingConverter`: Variation of the `org.springframework.messaging.converter.MappingJackson2MessageConverter`. Supports conversion of the payload of the `Message` to/from POJO for cases when `contentType` is `application/json` (DEFAULT). +. `TupleJsonMessageConverter`: *DEPRECATED* Supports conversion of the payload of the `Message` to/from `org.springframework.tuple.Tuple`. +. `ByteArrayMessageConverter`: Supports conversion of the payload of the `Message` from `byte[]` to `byte[]` for cases when `contentType` is `application/octet-stream`. It is essentially a pass through and exists primarily for backward compatibility. +. `ObjectStringMessageConverter`: Supports conversion of any type to a `String` when `contentType` is `text/plain`. +It invokes Object’s `toString()` method or, if the payload is `byte[]`, a new `String(byte[])`. +. `JavaSerializationMessageConverter`: *DEPRECATED* Supports conversion based on java serialization when `contentType` is `application/x-java-serialized-object`. +. `KryoMessageConverter`: *DEPRECATED* Supports conversion based on Kryo serialization when `contentType` is `application/x-java-object`. +. `JsonUnmarshallingConverter`: Similar to the `ApplicationJsonMessageMarshallingConverter`. It supports conversion of any type when `contentType` is `application/x-java-object`. +It expects the actual type information to be embedded in the `contentType` as an attribute (for example, `application/x-java-object;type=foo.bar.Cat`). + +When no appropriate converter is found, the framework throws an exception. When that happens, you should check your code and configuration and ensure you did not miss anything (that is, ensure that you provided a `contentType` by using a binding or a header). +However, most likely, you found some uncommon case (such as a custom `contentType` perhaps) and the current stack of provided `MessageConverters` +does not know how to convert. If that is the case, you can add custom `MessageConverter`. See <>. + +[[spring-cloud-stream-overview-user-defined-message-converters]] +=== User-defined Message Converters + +Spring Cloud Stream exposes a mechanism to define and register additional `MessageConverters`. +To use it, implement `org.springframework.messaging.converter.MessageConverter`, configure it as a `@Bean`, and annotate it with `@StreamMessageConverter`. +It is then apended to the existing stack of `MessageConverter`s. + +NOTE: It is important to understand that custom `MessageConverter` implementations are added to the head of the existing stack. +Consequently, custom `MessageConverter` implementations take precedence over the existing ones, which lets you override as well as add to the existing converters. + +The following example shows how to create a message converter bean to support a new content type called `application/bar`: + +[source,java] +---- +@EnableBinding(Sink.class) +@SpringBootApplication +public static class SinkApplication { + + ... + + @Bean + @StreamMessageConverter + public MessageConverter customMessageConverter() { + return new MyCustomMessageConverter(); + } +} + +public class MyCustomMessageConverter extends AbstractMessageConverter { + + public MyCustomMessageConverter() { + super(new MimeType("application", "bar")); + } + + @Override + protected boolean supports(Class clazz) { + return (Bar.class.equals(clazz)); + } + + @Override + protected Object convertFromInternal(Message message, Class targetClass, Object conversionHint) { + Object payload = message.getPayload(); + return (payload instanceof Bar ? payload : new Bar((byte[]) payload)); + } +} +---- + +Spring Cloud Stream also provides support for Avro-based converters and schema evolution. +See "`<>`" for details. + +[[schema-evolution]] +== Schema Evolution Support + +Spring Cloud Stream provides support for schema evolution so that the data can be evolved over time and still work with older or newer producers and consumers and vice versa. +Most serialization models, especially the ones that aim for portability across different platforms and languages, rely on a schema that describes how the data is serialized in the binary payload. +In order to serialize the data and then to interpret it, both the sending and receiving sides must have access to a schema that describes the binary format. +In certain cases, the schema can be inferred from the payload type on serialization or from the target type on deserialization. +However, many applications benefit from having access to an explicit schema that describes the binary data format. +A schema registry lets you store schema information in a textual format (typically JSON) and makes that information accessible to various applications that need it to receive and send data in binary format. +A schema is referenceable as a tuple consisting of: + +* A subject that is the logical name of the schema +* The schema version +* The schema format, which describes the binary format of the data + +This following sections goes through the details of various components involved in schema evolution process. + +=== Schema Registry Client + +The client-side abstraction for interacting with schema registry servers is the `SchemaRegistryClient` interface, which has the following structure: + +[source,java] +---- +public interface SchemaRegistryClient { + + SchemaRegistrationResponse register(String subject, String format, String schema); + + String fetch(SchemaReference schemaReference); + + String fetch(Integer id); + +} +---- + +Spring Cloud Stream provides out-of-the-box implementations for interacting with its own schema server and for interacting with the Confluent Schema Registry. + +A client for the Spring Cloud Stream schema registry can be configured by using the `@EnableSchemaRegistryClient`, as follows: + +[source,java] +---- + @EnableBinding(Sink.class) + @SpringBootApplication + @EnableSchemaRegistryClient + public static class AvroSinkApplication { + ... + } +---- + +NOTE: The default converter is optimized to cache not only the schemas from the remote server but also the `parse()` and `toString()` methods, which are quite expensive. +Because of this, it uses a `DefaultSchemaRegistryClient` that does not cache responses. +If you intend to change the default behavior, you can use the client directly on your code and override it to the desired outcome. +To do so, you have to add the property `spring.cloud.stream.schemaRegistryClient.cached=true` to your application properties. + +==== Schema Registry Client Properties + +The Schema Registry Client supports the following properties: + +`spring.cloud.stream.schemaRegistryClient.endpoint`:: The location of the schema-server. +When setting this, use a full URL, including protocol (`http` or `https`) , port, and context path. ++ +Default:: `http://localhost:8990/` +`spring.cloud.stream.schemaRegistryClient.cached`:: Whether the client should cache schema server responses. +Normally set to `false`, as the caching happens in the message converter. +Clients using the schema registry client should set this to `true`. ++ +Default:: `false` + +=== Avro Schema Registry Client Message Converters + +For applications that have a SchemaRegistryClient bean registered with the application context, Spring Cloud Stream auto configures an Apache Avro message converter for schema management. +This eases schema evolution, as applications that receive messages can get easy access to a writer schema that can be reconciled with their own reader schema. + +For outbound messages, if the content type of the channel is set to `application/*+avro`, the `MessageConverter` is activated, as shown in the following example: + +[source,properties] +---- +spring.cloud.stream.bindings.output.contentType=application/*+avro +---- + +During the outbound conversion, the message converter tries to infer the schema of each outbound messages (based on its type) and register it to a subject (based on the payload type) by using the `SchemaRegistryClient`. +If an identical schema is already found, then a reference to it is retrieved. +If not, the schema is registered, and a new version number is provided. +The message is sent with a `contentType` header by using the following scheme: `application/[prefix].[subject].v[version]+avro`, where `prefix` is configurable and `subject` is deduced from the payload type. + +For example, a message of the type `User` might be sent as a binary payload with a content type of `application/vnd.user.v2+avro`, where `user` is the subject and `2` is the version number. + +When receiving messages, the converter infers the schema reference from the header of the incoming message and tries to retrieve it. The schema is used as the writer schema in the deserialization process. + +==== Avro Schema Registry Message Converter Properties + +If you have enabled Avro based schema registry client by setting `spring.cloud.stream.bindings.output.contentType=application/*+avro`, you can customize the behavior of the registration by setting the following properties. + +spring.cloud.stream.schema.avro.dynamicSchemaGenerationEnabled:: Enable if you want the converter to use reflection to infer a Schema from a POJO. ++ +Default: `false` ++ +spring.cloud.stream.schema.avro.readerSchema:: Avro compares schema versions by looking at a writer schema (origin payload) and a reader schema (your application payload). See the https://avro.apache.org/docs/1.7.6/spec.html[Avro documentation] for more information. If set, this overrides any lookups at the schema server and uses the local schema as the reader schema. +Default: `null` ++ +spring.cloud.stream.schema.avro.schemaLocations:: Registers any `.avsc` files listed in this property with the Schema Server. ++ +Default: `empty` ++ +spring.cloud.stream.schema.avro.prefix:: The prefix to be used on the Content-Type header. ++ +Default: `vnd` + +=== Apache Avro Message Converters + +Spring Cloud Stream provides support for schema-based message converters through its `spring-cloud-stream-schema` module. +Currently, the only serialization format supported out of the box for schema-based message converters is Apache Avro, with more formats to be added in future versions. + +The `spring-cloud-stream-schema` module contains two types of message converters that can be used for Apache Avro serialization: + +* Converters that use the class information of the serialized or deserialized objects or a schema with a location known at startup. +* Converters that use a schema registry. They locate the schemas at runtime and dynamically register new schemas as domain objects evolve. + +=== Converters with Schema Support + +The `AvroSchemaMessageConverter` supports serializing and deserializing messages either by using a predefined schema or by using the schema information available in the class (either reflectively or contained in the `SpecificRecord`). +If you provide a custom converter, then the default AvroSchemaMessageConverter bean is not created. The following example shows a custom converter: + +To use custom converters, you can simply add it to the application context, optionally specifying one or more `MimeTypes` with which to associate it. +The default `MimeType` is `application/avro`. + +If the target type of the conversion is a `GenericRecord`, a schema must be set. + +The following example shows how to configure a converter in a sink application by registering the Apache Avro `MessageConverter` without a predefined schema. +In this example, note that the mime type value is `avro/bytes`, not the default `application/avro`. + +[source,java] +---- +@EnableBinding(Sink.class) +@SpringBootApplication +public static class SinkApplication { + + ... + + @Bean + public MessageConverter userMessageConverter() { + return new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes")); + } +} +---- + +Conversely, the following application registers a converter with a predefined schema (found on the classpath): + +[source,java] +---- +@EnableBinding(Sink.class) +@SpringBootApplication +public static class SinkApplication { + + ... + + @Bean + public MessageConverter userMessageConverter() { + AvroSchemaMessageConverter converter = new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes")); + converter.setSchemaLocation(new ClassPathResource("schemas/User.avro")); + return converter; + } +} +---- + +=== Schema Registry Server + +Spring Cloud Stream provides a schema registry server implementation. +To use it, you can add the `spring-cloud-stream-schema-server` artifact to your project and use the `@EnableSchemaRegistryServer` annotation, which adds the schema registry server REST controller to your application. +This annotation is intended to be used with Spring Boot web applications, and the listening port of the server is controlled by the `server.port` property. +The `spring.cloud.stream.schema.server.path` property can be used to control the root path of the schema server (especially when it is embedded in other applications). +The `spring.cloud.stream.schema.server.allowSchemaDeletion` boolean property enables the deletion of a schema. By default, this is disabled. + +The schema registry server uses a relational database to store the schemas. +By default, it uses an embedded database. +You can customize the schema storage by using the http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-sql[Spring Boot SQL database and JDBC configuration options]. + +The following example shows a Spring Boot application that enables the schema registry: + +[source,java] +---- +@SpringBootApplication +@EnableSchemaRegistryServer +public class SchemaRegistryServerApplication { + public static void main(String[] args) { + SpringApplication.run(SchemaRegistryServerApplication.class, args); + } +} +---- + +==== Schema Registry Server API + +The Schema Registry Server API consists of the following operations: + +* `POST /` -- see "`<>`" +* 'GET /{subject}/{format}/{version}' -- see "`<>`" +* `GET /{subject}/{format}` -- see "`<>`" +* `GET /schemas/{id}` -- see "`<>`" +* `DELETE /{subject}/{format}/{version}` -- see "`<>`" +* `DELETE /schemas/{id}` -- see "`<>`" +* `DELETE /{subject}` -- see "`<>`" + +[[spring-cloud-stream-overview-registering-new-schema]] +===== Registering a New Schema + +To register a new schema, send a `POST` request to the `/` endpoint. + +The `/` accepts a JSON payload with the following fields: + +* `subject`: The schema subject +* `format`: The schema format +* `definition`: The schema definition + +Its response is a schema object in JSON, with the following fields: + +* `id`: The schema ID +* `subject`: The schema subject +* `format`: The schema format +* `version`: The schema version +* `definition`: The schema definition + +[[spring-cloud-stream-overview-retrieve-schema-subject-format-version]] +===== Retrieving an Existing Schema by Subject, Format, and Version + +To retrieve an existing schema by subject, format, and version, send `GET` request to the `/{subject}/{format}/{version}` endpoint. + +Its response is a schema object in JSON, with the following fields: + +* `id`: The schema ID +* `subject`: The schema subject +* `format`: The schema format +* `version`: The schema version +* `definition`: The schema definition + +[[spring-cloud-stream-overview-retrieve-schema-subject-format]] +===== Retrieving an Existing Schema by Subject and Format + +To retrieve an existing schema by subject and format, send a `GET` request to the `/subject/format` endpoint. + +Its response is a list of schemas with each schema object in JSON, with the following fields: + +* `id`: The schema ID +* `subject`: The schema subject +* `format`: The schema format +* `version`: The schema version +* `definition`: The schema definition + +[[spring-cloud-stream-overview-retrieve-schema-id]] +===== Retrieving an Existing Schema by ID + +To retrieve a schema by its ID, send a `GET` request to the `/schemas/{id}` endpoint. + +Its response is a schema object in JSON, with the following fields: + +* `id`: The schema ID +* `subject`: The schema subject +* `format`: The schema format +* `version`: The schema version +* `definition`: The schema definition + +[[spring-cloud-stream-overview-deleting-schema-subject-format-version]] +===== Deleting a Schema by Subject, Format, and Version + +To delete a schema identified by its subject, format, and version, send a `DELETE` request to the `/{subject}/{format}/{version}` endpoint. + +[[spring-cloud-stream-overview-deleting-schema-id]] +===== Deleting a Schema by ID + +To delete a schema by its ID, send a `DELETE` request to the `/schemas/{id}` endpoint. + +[[spring-cloud-stream-overview-deleting-schema-subject]] +===== Deleting a Schema by Subject +`DELETE /{subject}` + +Delete existing schemas by their subject. + +NOTE: This note applies to users of Spring Cloud Stream 1.1.0.RELEASE only. +Spring Cloud Stream 1.1.0.RELEASE used the table name, `schema`, for storing `Schema` objects. `Schema` is a keyword in a number of database implementations. +To avoid any conflicts in the future, starting with 1.1.1.RELEASE, we have opted for the name `SCHEMA_REPOSITORY` for the storage table. +Any Spring Cloud Stream 1.1.0.RELEASE users who upgrade should migrate their existing schemas to the new table before upgrading. + +==== Using Confluent's Schema Registry + +The default configuration creates a `DefaultSchemaRegistryClient` bean. +If you want to use the Confluent schema registry, you need to create a bean of type `ConfluentSchemaRegistryClient`, which supersedes the one configured by default by the framework. The following example shows how to create such a bean: + +[source,java] +---- +@Bean +public SchemaRegistryClient schemaRegistryClient(@Value("${spring.cloud.stream.schemaRegistryClient.endpoint}") String endpoint){ + ConfluentSchemaRegistryClient client = new ConfluentSchemaRegistryClient(); + client.setEndpoint(endpoint); + return client; +} +---- +NOTE: The ConfluentSchemaRegistryClient is tested against Confluent platform version 4.0.0. + +=== Schema Registration and Resolution + +To better understand how Spring Cloud Stream registers and resolves new schemas and its use of Avro schema comparison features, we provide two separate subsections: + +* "`<>`" +* "`<>`" + +[[spring-cloud-stream-overview-schema-registration-process]] +==== Schema Registration Process (Serialization) + +The first part of the registration process is extracting a schema from the payload that is being sent over a channel. +Avro types such as `SpecificRecord` or `GenericRecord` already contain a schema, which can be retrieved immediately from the instance. +In the case of POJOs, a schema is inferred if the `spring.cloud.stream.schema.avro.dynamicSchemaGenerationEnabled` property is set to `true` (the default). + +.Schema Writer Resolution Process +image::schema_resolution.png[width=800,scaledwidth="75%",align="center"] + +Ones a schema is obtained, the converter loads its metadata (version) from the remote server. +First, it queries a local cache. If no result is found, it submits the data to the server, which replies with versioning information. +The converter always caches the results to avoid the overhead of querying the Schema Server for every new message that needs to be serialized. + +.Schema Registration Process +image::registration.png[width=800,scaledwidth="75%",align="center"] + +With the schema version information, the converter sets the `contentType` header of the message to carry the version information -- for example: `application/vnd.user.v1+avro`. + +[[spring-cloud-stream-overview-schema-resolution-process]] +==== Schema Resolution Process (Deserialization) + +When reading messages that contain version information (that is, a `contentType` header with a scheme like the one described under "`<>`"), the converter queries the Schema server to fetch the writer schema of the message. +Once it has found the correct schema of the incoming message, it retrieves the reader schema and, by using Avro's schema resolution support, reads it into the reader definition (setting defaults and any missing properties). + +.Schema Reading Resolution Process +image::schema_reading.png[width=800,scaledwidth="75%",align="center"] + +NOTE: You should understand the difference between a writer schema (the application that wrote the message) and a reader schema (the receiving application). +We suggest taking a moment to read https://avro.apache.org/docs/1.7.6/spec.html[the Avro terminology] and understand the process. +Spring Cloud Stream always fetches the writer schema to determine how to read a message. +If you want to get Avro's schema evolution support working, you need to make sure that a `readerSchema` was properly set for your application. + +== Inter-Application Communication + +Spring Cloud Stream enables communication between applications. Inter-application communication is a complex issue spanning several concerns, as described in the following topics: + +* "`<>`" +* "`<>`" +* "`<>`" + +[[spring-cloud-stream-overview-connecting-multiple-application-instances]] +=== Connecting Multiple Application Instances + +While Spring Cloud Stream makes it easy for individual Spring Boot applications to connect to messaging systems, the typical scenario for Spring Cloud Stream is the creation of multi-application pipelines, where microservice applications send data to each other. +You can achieve this scenario by correlating the input and output destinations of "`adjacent`" applications. + +Suppose a design calls for the Time Source application to send data to the Log Sink application. You could use a common destination named `ticktock` for bindings within both applications. + +Time Source (that has the channel name `output`) would set the following property: + +---- +spring.cloud.stream.bindings.output.destination=ticktock +---- + +Log Sink (that has the channel name `input`) would set the following property: + +---- +spring.cloud.stream.bindings.input.destination=ticktock +---- + +[[spring-cloud-stream-overview-instance-index-instance-count]] +=== Instance Index and Instance Count + +When scaling up Spring Cloud Stream applications, each instance can receive information about how many other instances of the same application exist and what its own instance index is. +Spring Cloud Stream does this through the `spring.cloud.stream.instanceCount` and `spring.cloud.stream.instanceIndex` properties. +For example, if there are three instances of a HDFS sink application, all three instances have `spring.cloud.stream.instanceCount` set to `3`, and the individual applications have `spring.cloud.stream.instanceIndex` set to `0`, `1`, and `2`, respectively. + +When Spring Cloud Stream applications are deployed through Spring Cloud Data Flow, these properties are configured automatically; when Spring Cloud Stream applications are launched independently, these properties must be set correctly. +By default, `spring.cloud.stream.instanceCount` is `1`, and `spring.cloud.stream.instanceIndex` is `0`. + +In a scaled-up scenario, correct configuration of these two properties is important for addressing partitioning behavior (see below) in general, and the two properties are always required by certain binders (for example, the Kafka binder) in order to ensure that data are split correctly across multiple consumer instances. + +[[spring-cloud-stream-overview-partitioning]] +=== Partitioning + +Partitioning in Spring Cloud Stream consists of two tasks: + +* "`<>`" +* "`<>`" + +[[spring-cloud-stream-overview-configuring-output-bindings-partitioning]] +==== Configuring Output Bindings for Partitioning + +You can configure an output binding to send partitioned data by setting one and only one of its `partitionKeyExpression` or `partitionKeyExtractorName` properties, as well as its `partitionCount` property. + +For example, the following is a valid and typical configuration: + +---- +spring.cloud.stream.bindings.output.producer.partitionKeyExpression=payload.id +spring.cloud.stream.bindings.output.producer.partitionCount=5 +---- + +Based on that example configuration, data is sent to the target partition by using the following logic. + +A partition key's value is calculated for each message sent to a partitioned output channel based on the `partitionKeyExpression`. +The `partitionKeyExpression` is a SpEL expression that is evaluated against the outbound message for extracting the partitioning key. + +If a SpEL expression is not sufficient for your needs, you can instead calculate the partition key value by providing an implementation of `org.springframework.cloud.stream.binder.PartitionKeyExtractorStrategy` and configuring it as a bean (by using the `@Bean` annotation). +If you have more then one bean of type `org.springframework.cloud.stream.binder.PartitionKeyExtractorStrategy` available in the Application Context, you can further filter it by specifying its name with the `partitionKeyExtractorName` property, as shown in the following example: + +[source] +---- +--spring.cloud.stream.bindings.output.producer.partitionKeyExtractorName=customPartitionKeyExtractor +--spring.cloud.stream.bindings.output.producer.partitionCount=5 +. . . +@Bean +public CustomPartitionKeyExtractorClass customPartitionKeyExtractor() { + return new CustomPartitionKeyExtractorClass(); +} +---- + +NOTE: In previous versions of Spring Cloud Stream, you could specify the implementation of `org.springframework.cloud.stream.binder.PartitionKeyExtractorStrategy` by setting the `spring.cloud.stream.bindings.output.producer.partitionKeyExtractorClass` property. +Since version 2.0, this property is deprecated, and support for it will be removed in a future version. + +Once the message key is calculated, the partition selection process determines the target partition as a value between `0` and `partitionCount - 1`. +The default calculation, applicable in most scenarios, is based on the following formula: `key.hashCode() % partitionCount`. +This can be customized on the binding, either by setting a SpEL expression to be evaluated against the 'key' (through the `partitionSelectorExpression` property) or by configuring an implementation of `org.springframework.cloud.stream.binder.PartitionSelectorStrategy` as a bean (by using the @Bean annotation). +Similar to the `PartitionKeyExtractorStrategy`, you can further filter it by using the `spring.cloud.stream.bindings.output.producer.partitionSelectorName` property when more than one bean of this type is available in the Application Context, as shown in the following example: + +[source] +---- +--spring.cloud.stream.bindings.output.producer.partitionSelectorName=customPartitionSelector +. . . +@Bean +public CustomPartitionSelectorClass customPartitionSelector() { + return new CustomPartitionSelectorClass(); +} +---- + +NOTE: In previous versions of Spring Cloud Stream you could specify the implementation of `org.springframework.cloud.stream.binder.PartitionSelectorStrategy` by setting the `spring.cloud.stream.bindings.output.producer.partitionSelectorClass` property. +Since version 2.0, this property is deprecated and support for it will be removed in a future version. + +[[spring-cloud-stream-overview-configuring-input-bindings-partitioning]] +==== Configuring Input Bindings for Partitioning + +An input binding (with the channel name `input`) is configured to receive partitioned data by setting its `partitioned` property, as well as the `instanceIndex` and `instanceCount` properties on the application itself, as shown in the following example: + +---- +spring.cloud.stream.bindings.input.consumer.partitioned=true +spring.cloud.stream.instanceIndex=3 +spring.cloud.stream.instanceCount=5 +---- + +The `instanceCount` value represents the total number of application instances between which the data should be partitioned. +The `instanceIndex` must be a unique value across the multiple instances, with a value between `0` and `instanceCount - 1`. +The instance index helps each application instance to identify the unique partition(s) from which it receives data. +It is required by binders using technology that does not support partitioning natively. +For example, with RabbitMQ, there is a queue for each partition, with the queue name containing the instance index. +With Kafka, if `autoRebalanceEnabled` is `true` (default), Kafka takes care of distributing partitions across instances, and these properties are not required. +If `autoRebalanceEnabled` is set to false, the `instanceCount` and `instanceIndex` are used by the binder to determine which partition(s) the instance subscribes to (you must have at least as many partitions as there are instances). +The binder allocates the partitions instead of Kafka. +This might be useful if you want messages for a particular partition to always go to the same instance. +When a binder configuration requires them, it is important to set both values correctly in order to ensure that all of the data is consumed and that the application instances receive mutually exclusive datasets. + +While a scenario in which using multiple instances for partitioned data processing may be complex to set up in a standalone case, Spring Cloud Dataflow can simplify the process significantly by populating both the input and output values correctly and by letting you rely on the runtime infrastructure to provide information about the instance index and instance count. + +== Testing + +Spring Cloud Stream provides support for testing your microservice applications without connecting to a messaging system. +You can do that by using the `TestSupportBinder` provided by the `spring-cloud-stream-test-support` library, which can be added as a test dependency to the application, as shown in the following example: + +[source,xml] +---- + + org.springframework.cloud + spring-cloud-stream-test-support + test + +---- + +NOTE: The `TestSupportBinder` uses the Spring Boot autoconfiguration mechanism to supersede the other binders found on the classpath. +Therefore, when adding a binder as a dependency, you must make sure that the `test` scope is being used. + +The `TestSupportBinder` lets you interact with the bound channels and inspect any messages sent and received by the application. + +For outbound message channels, the `TestSupportBinder` registers a single subscriber and retains the messages emitted by the application in a `MessageCollector`. +They can be retrieved during tests and have assertions made against them. + +You can also send messages to inbound message channels so that the consumer application can consume the messages. +The following example shows how to test both input and output channels on a processor: + +[source,java] +---- +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT) +public class ExampleTest { + + @Autowired + private Processor processor; + + @Autowired + private MessageCollector messageCollector; + + @Test + @SuppressWarnings("unchecked") + public void testWiring() { + Message message = new GenericMessage<>("hello"); + processor.input().send(message); + Message received = (Message) messageCollector.forChannel(processor.output()).poll(); + assertThat(received.getPayload(), equalTo("hello world")); + } + + + @SpringBootApplication + @EnableBinding(Processor.class) + public static class MyProcessor { + + @Autowired + private Processor channels; + + @Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT) + public String transform(String in) { + return in + " world"; + } + } +} +---- + +In the preceding example, we create an application that has an input channel and an output channel, both bound through the `Processor` interface. +The bound interface is injected into the test so that we can have access to both channels. +We send a message on the input channel, and we use the `MessageCollector` provided by Spring Cloud Stream's test support to capture that the message has been sent to the output channel as a result. +Once we have received the message, we can validate that the component functions correctly. + +=== Disabling the Test Binder Autoconfiguration + +The intent behind the test binder superseding all the other binders on the classpath is to make it easy to test your applications without making changes to your production dependencies. +In some cases (for example, integration tests) it is useful to use the actual production binders instead, and that requires disabling the test binder autoconfiguration. +To do so, you can exclude the `org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration` class by using one of the Spring Boot autoconfiguration exclusion mechanisms, as shown in the following example: + +[source,java] +---- + @SpringBootApplication(exclude = TestSupportBinderAutoConfiguration.class) + @EnableBinding(Processor.class) + public static class MyProcessor { + + @Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT) + public String transform(String in) { + return in + " world"; + } + } +---- + +When autoconfiguration is disabled, the test binder is available on the classpath, and its `defaultCandidate` property is set to `false` so that it does not interfere with the regular user configuration. It can be referenced under the name, `test`, as shown in the following example: + +`spring.cloud.stream.defaultBinder=test` + +== Health Indicator + +Spring Cloud Stream provides a health indicator for binders. +It is registered under the name `binders` and can be enabled or disabled by setting the `management.health.binders.enabled` property. + +To enable health check you first need to enable both "web" and "actuator" by including its dependencies (see <>) + +If `management.health.binders.enabled` is not set explicitly by the application, then `management.health.defaults.enabled` is matched as `true` and the binder health indicators are enabled. +If you want to disable health indicator completely, then you have to set `management.health.binders.enabled` to `false`. + +You can use Spring Boot actuator health endpoint to access the health indicator - `/actuator/health`. +By default, you will only receive the top level application status when you hit the above endpoint. +In order to receive the full details from the binder specific health indicators, you need to include the property `management.endpoint.health.show-details` with the value `ALWAYS` in your application. + +Health indicators are binder-specific and certain binder implementations may not necessarily provide a health indicator. + +If you want to completely disable all health indicators available out of the box and instead provide your own health indicators, +you can do so by setting property `management.health.binders.enabled` to `false` and then provide your own `HealthIndicator` beans in your application. +In this case, the health indicator infrastructure from Spring Boot will still pick up these custom beans. +Even if you are not disabling the binder health indicators, you can still enhance the health checks by providing your own `HealthIndicator` beans in addition to the out of the box health checks. + +When you have multiple binders in the same application, health indicators are enabled by default unless the application turns them off by setting `management.health.binders.enabled` to `false`. +In this case, if the user wants to disable health check for a subset of the binders, then that should be done by setting `management.health.binders.enabled` to `false` in the multi binder configurations's environment. +See <> for details on how environment specific properties can be provided. + + +[[spring-cloud-stream-overview-metrics-emitter]] +== Metrics Emitter + +Spring Boot Actuator provides dependency management and auto-configuration for https://micrometer.io/[Micrometer], an application metrics +facade that supports numerous https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#production-ready-metrics[monitoring systems]. + +Spring Cloud Stream provides support for emitting any available micrometer-based metrics to a binding destination, allowing for periodic +collection of metric data from stream applications without relying on polling individual endpoints. + +Metrics Emitter is activated by defining the `spring.cloud.stream.bindings.applicationMetrics.destination` property, +which specifies the name of the binding destination used by the current binder to publish metric messages. + +For example: +[source,java] +---- +spring.cloud.stream.bindings.applicationMetrics.destination=myMetricDestination +---- +The preceding example instructs the binder to bind to `myMetricDestination` (that is, Rabbit exchange, Kafka topic, and others). + +The following properties can be used for customizing the emission of metrics: + +spring.cloud.stream.metrics.key:: +The name of the metric being emitted. Should be a unique value per application. ++ +Default: `${spring.application.name:${vcap.application.name:${spring.config.name:application}}}` ++ +spring.cloud.stream.metrics.properties:: +Allows white listing application properties that are added to the metrics payload ++ +Default: null. ++ +spring.cloud.stream.metrics.meter-filter:: +Pattern to control the 'meters' one wants to capture. +For example, specifying `spring.integration.*` captures metric information for meters whose name starts with `spring.integration.` ++ +Default: all 'meters' are captured. ++ +spring.cloud.stream.metrics.schedule-interval:: +Interval to control the rate of publishing metric data. ++ +Default: 1 min + +Consider the following: + +[source,bash] +---- +java -jar time-source.jar \ + --spring.cloud.stream.bindings.applicationMetrics.destination=someMetrics \ + --spring.cloud.stream.metrics.properties=spring.application** \ + --spring.cloud.stream.metrics.meter-filter=spring.integration.* +---- + +The following example shows the payload of the data published to the binding destination as a result of the preceding command: + +[source,javascript] +---- +{ + "name": "application", + "createdTime": "2018-03-23T14:48:12.700Z", + "properties": { + }, + "metrics": [ + { + "id": { + "name": "spring.integration.send", + "tags": [ + { + "key": "exception", + "value": "none" + }, + { + "key": "name", + "value": "input" + }, + { + "key": "result", + "value": "success" + }, + { + "key": "type", + "value": "channel" + } + ], + "type": "TIMER", + "description": "Send processing time", + "baseUnit": "milliseconds" + }, + "timestamp": "2018-03-23T14:48:12.697Z", + "sum": 130.340546, + "count": 6, + "mean": 21.72342433333333, + "upper": 116.176299, + "total": 130.340546 + } + ] +} +---- + +NOTE: Given that the format of the Metric message has slightly changed after migrating to Micrometer, the published message will also have +a `STREAM_CLOUD_STREAM_VERSION` header set to `2.x` to help distinguish between Metric messages from the older versions of the Spring Cloud Stream. + +== Samples + +For Spring Cloud Stream samples, see the https://github.com/spring-cloud/spring-cloud-stream-samples[spring-cloud-stream-samples] repository on GitHub. + +=== Deploying Stream Applications on CloudFoundry + +On CloudFoundry, services are usually exposed through a special environment variable called https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES[VCAP_SERVICES]. + +When configuring your binder connections, you can use the values from an environment variable as explained on the http://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/current-SNAPSHOT/reference/htmlsingle/#getting-started-ups[dataflow Cloud Foundry Server] docs. \ No newline at end of file diff --git a/spring-cloud-stream-core-docs/.jdk8 b/docs/.jdk8 similarity index 100% rename from spring-cloud-stream-core-docs/.jdk8 rename to docs/.jdk8 diff --git a/docs/pom.xml b/docs/pom.xml new file mode 100644 index 000000000..43b2aa920 --- /dev/null +++ b/docs/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + spring-cloud-stream-core-docs + + org.springframework.cloud + spring-cloud-stream-parent + 2.1.0.BUILD-SNAPSHOT + + pom + spring-cloud-stream-core-docs + Spring Cloud Stream Core Documentation + + spring-cloud-stream + ${basedir}/.. + + + + docs + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.asciidoctor + asciidoctor-maven-plugin + false + + + com.agilejava.docbkx + docbkx-maven-plugin + + + org.apache.maven.plugins + maven-antrun-plugin + false + + + org.codehaus.mojo + build-helper-maven-plugin + false + + + + + + + \ No newline at end of file diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc b/docs/src/main/asciidoc/README.adoc similarity index 98% rename from spring-cloud-stream-core-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc rename to docs/src/main/asciidoc/README.adoc index 1829b9bba..10a3d06c5 100644 --- a/spring-cloud-stream-core-docs/src/main/asciidoc/spring-cloud-stream-overview.adoc +++ b/docs/src/main/asciidoc/README.adoc @@ -1,3 +1,12 @@ +:github-tag: master +:github-repo: spring-cloud/spring-cloud-stream +:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag} +:github-code: https://github.com/{github-repo}/tree/{github-tag} +:toc: left +:toclevels: 8 +:nofooter: +:sectlinks: true + [partintro] -- This section goes into more detail about how you can work with Spring Cloud Stream. @@ -93,7 +102,7 @@ The application communicates with the outside world through input and output cha Channels are connected to external brokers through middleware-specific Binder implementations. .Spring Cloud Stream Application -image::SCSt-with-binder.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/SCSt-with-binder.png[width=800,scaledwidth="75%",align="center"] ==== Fat JAR @@ -124,7 +133,7 @@ Communication between applications follows a publish-subscribe model, where data This can be seen in the following figure, which shows a typical deployment for a set of interacting Spring Cloud Stream applications. .Spring Cloud Stream Publish-Subscribe -image::SCSt-sensors.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/SCSt-sensors.png[width=800,scaledwidth="75%",align="center"] Data reported by sensors to an HTTP endpoint is sent to a common destination named `raw-sensor-data`. From the destination, it is independently processed by a microservice application that computes time-windowed averages and by another microservice application that ingests the raw data into HDFS (Hadoop Distributed File System). @@ -149,7 +158,7 @@ Each consumer binding can use the `spring.cloud.stream.bindings..gr For the consumers shown in the following figure, this property would be set as `spring.cloud.stream.bindings..group=hdfsWrite` or `spring.cloud.stream.bindings..group=average`. .Spring Cloud Stream Consumer Groups -image::SCSt-groups.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/SCSt-groups.png[width=800,scaledwidth="75%",align="center"] All groups that subscribe to a given destination receive a copy of published data, but only one member of each group receives a given message from that destination. By default, when a group is not specified, Spring Cloud Stream assigns the application to an anonymous and independent single-member consumer group that is in a publish-subscribe relationship with all other consumer groups. @@ -194,7 +203,7 @@ Spring Cloud Stream provides a common abstraction for implementing partitioned p Partitioning can thus be used whether the broker itself is naturally partitioned (for example, Kafka) or not (for example, RabbitMQ). .Spring Cloud Stream Partitioning -image::SCSt-partitioning.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/SCSt-partitioning.png[width=800,scaledwidth="75%",align="center"] Partitioning is a critical concept in stateful processing, where it is critical (for either performance or consistency reasons) to ensure that all related data is processed together. For example, in the time-windowed average calculation example, it is important that all measurements from any given sensor are processed by the same application instance. @@ -209,7 +218,7 @@ To understand the programming model, you should be familiar with the following c * *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). -image::SCSt-overview.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/SCSt-overview.png[width=800,scaledwidth="75%",align="center"] === Destination Binders @@ -787,7 +796,7 @@ the error back to the messaging system (re-queue, DLQ, and others). There are two types of application-level error handling. Errors can be handled at each binding subscription or a global handler can handle all the binding subscription errors. Let's review the details. .A Spring Cloud Stream Sink Application with Custom and Global Error Handlers -image::custom_vs_global_error_channels.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/custom_vs_global_error_channels.png[width=800,scaledwidth="75%",align="center"] For each input binding, Spring Cloud Stream creates a dedicated error channel with the following semantics `.errors`. @@ -1170,7 +1179,7 @@ This section provides information about the main concepts behind the Binder SPI, The following image shows the general relationship of producers and consumers: .Producers and Consumers -image::producers-consumers.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/producers-consumers.png[width=800,scaledwidth="75%",align="center"] A producer is any component that sends messages to a channel. The channel can be bound to an external message broker with a `Binder` implementation for that broker. @@ -2224,14 +2233,14 @@ Avro types such as `SpecificRecord` or `GenericRecord` already contain a schema, In the case of POJOs, a schema is inferred if the `spring.cloud.stream.schema.avro.dynamicSchemaGenerationEnabled` property is set to `true` (the default). .Schema Writer Resolution Process -image::schema_resolution.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/schema_resolution.png[width=800,scaledwidth="75%",align="center"] Ones a schema is obtained, the converter loads its metadata (version) from the remote server. First, it queries a local cache. If no result is found, it submits the data to the server, which replies with versioning information. The converter always caches the results to avoid the overhead of querying the Schema Server for every new message that needs to be serialized. .Schema Registration Process -image::registration.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/registration.png[width=800,scaledwidth="75%",align="center"] With the schema version information, the converter sets the `contentType` header of the message to carry the version information -- for example: `application/vnd.user.v1+avro`. @@ -2242,7 +2251,7 @@ When reading messages that contain version information (that is, a `contentType` Once it has found the correct schema of the incoming message, it retrieves the reader schema and, by using Avro's schema resolution support, reads it into the reader definition (setting defaults and any missing properties). .Schema Reading Resolution Process -image::schema_reading.png[width=800,scaledwidth="75%",align="center"] +image::{github-raw}/docs/src/main/asciidoc/images/schema_reading.png[width=800,scaledwidth="75%",align="center"] NOTE: You should understand the difference between a writer schema (the application that wrote the message) and a reader schema (the receiving application). We suggest taking a moment to read https://avro.apache.org/docs/1.7.6/spec.html[the Avro terminology] and understand the process. diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/appendix.adoc b/docs/src/main/asciidoc/appendix.adoc similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/appendix.adoc rename to docs/src/main/asciidoc/appendix.adoc diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/building.adoc b/docs/src/main/asciidoc/building.adoc similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/building.adoc rename to docs/src/main/asciidoc/building.adoc diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/contributing.adoc b/docs/src/main/asciidoc/contributing.adoc similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/contributing.adoc rename to docs/src/main/asciidoc/contributing.adoc diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh new file mode 100755 index 000000000..6795216e9 --- /dev/null +++ b/docs/src/main/asciidoc/ghpages.sh @@ -0,0 +1,330 @@ +#!/bin/bash -x + +set -e + +# Set default props like MAVEN_PATH, ROOT_FOLDER etc. +function set_default_props() { + # The script should be executed from the root folder + ROOT_FOLDER=`pwd` + echo "Current folder is ${ROOT_FOLDER}" + + if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then + echo "You're not in the root folder of the project!" + exit 1 + fi + + # Prop that will let commit the changes + COMMIT_CHANGES="no" + MAVEN_PATH=${MAVEN_PATH:-} + echo "Path to Maven is [${MAVEN_PATH}]" + REPO_NAME=${PWD##*/} + echo "Repo name is [${REPO_NAME}]" + SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git} + echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}" +} + +# Check if gh-pages exists and docs have been built +function check_if_anything_to_sync() { + git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'` + + if ! (git remote set-branches --add origin gh-pages && git fetch -q); then + echo "No gh-pages, so not syncing" + exit 0 + fi + + if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then + echo "No gh-pages sources in docs/target/generated-docs, so not syncing" + exit 0 + fi +} + +function retrieve_current_branch() { + # Code getting the name of the current branch. For master we want to publish as we did until now + # http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch + # If there is a branch already passed will reuse it - otherwise will try to find it + CURRENT_BRANCH=${BRANCH} + if [[ -z "${CURRENT_BRANCH}" ]] ; then + CURRENT_BRANCH=$(git symbolic-ref -q HEAD) + CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/} + CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD} + fi + echo "Current branch is [${CURRENT_BRANCH}]" + git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script" +} + +# Switches to the provided value of the release version. We always prefix it with `v` +function switch_to_tag() { + git checkout v${VERSION} +} + +# Build the docs if switch is on +function build_docs_if_applicable() { + if [[ "${BUILD}" == "yes" ]] ; then + ./mvnw clean install -P docs -pl docs -DskipTests + fi +} + +# Get the name of the `docs.main` property +# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile +function retrieve_doc_properties() { + MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \ + -Dexec.executable="echo" \ + -Dexec.args='${docs.main}' \ + --non-recursive \ + org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) + echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]" + + + WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"} + WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \ + -Dexec.executable="echo" \ + -Dexec.args="\${${WHITELIST_PROPERTY}}" \ + org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \ + -P docs \ + -pl docs) + echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]" +} + +# Stash any outstanding changes +function stash_changes() { + git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1") + if [ "$dirty" != "0" ]; then git stash; fi +} + +# Switch to gh-pages branch to sync it with current branch +function add_docs_from_target() { + local DESTINATION_REPO_FOLDER + if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then + DESTINATION_REPO_FOLDER=${ROOT_FOLDER} + elif [[ "${CLONE}" == "yes" ]]; then + mkdir -p ${ROOT_FOLDER}/target + local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static + if [[ ! -e "${clonedStatic}/.git" ]]; then + echo "Cloning Spring Cloud Static to target" + git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && git checkout gh-pages + else + echo "Spring Cloud Static already cloned - will pull changes" + cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages + fi + DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME} + mkdir -p ${DESTINATION_REPO_FOLDER} + else + if [[ ! -e "${DESTINATION}/.git" ]]; then + echo "[${DESTINATION}] is not a git repository" + exit 1 + fi + DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME} + mkdir -p ${DESTINATION_REPO_FOLDER} + echo "Destination was provided [${DESTINATION}]" + fi + cd ${DESTINATION_REPO_FOLDER} + git checkout gh-pages + git pull origin gh-pages + + # Add git branches + ################################################################### + if [[ -z "${VERSION}" ]] ; then + copy_docs_for_current_version + else + copy_docs_for_provided_version + fi + commit_changes_if_applicable +} + + +# Copies the docs by using the retrieved properties from Maven build +function copy_docs_for_current_version() { + if [[ "${CURRENT_BRANCH}" == "master" ]] ; then + echo -e "Current branch is master - will copy the current docs only to the root folder" + for f in docs/target/generated-docs/*; do + file=${f#docs/target/generated-docs/*} + if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then + # Not ignored... + cp -rf $f ${ROOT_FOLDER}/ + git add -A ${ROOT_FOLDER}/$file + fi + done + COMMIT_CHANGES="yes" + else + echo -e "Current branch is [${CURRENT_BRANCH}]" + # http://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin + if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then + mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH} + echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder" + for f in docs/target/generated-docs/*; do + file=${f#docs/target/generated-docs/*} + if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then + # Not ignored... + # We want users to access 2.0.0.BUILD-SNAPSHOT/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html + if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then + # We don't want to copy the spring-cloud-sleuth.html + # we want it to be converted to index.html + cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html + git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html + else + cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH} + git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file + fi + fi + done + COMMIT_CHANGES="yes" + else + echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in + [docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch." + fi + fi +} + +# Copies the docs by using the explicitly provided version +function copy_docs_for_provided_version() { + local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION} + mkdir -p ${FOLDER} + echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder" + for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do + file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*} + copy_docs_for_branch ${file} ${FOLDER} + done + COMMIT_CHANGES="yes" + CURRENT_BRANCH="v${VERSION}" +} + +# Copies the docs from target to the provided destination +# Params: +# $1 - file from target +# $2 - destination to which copy the files +function copy_docs_for_branch() { + local file=$1 + local destination=$2 + if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then + # Not ignored... + # We want users to access 2.0.0.BUILD-SNAPSHOT/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html + if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then + # We don't want to copy the spring-cloud-sleuth.html + # we want it to be converted to index.html + cp -rf $f ${destination}/index.html + git add -A ${destination}/index.html + else + cp -rf $f ${destination} + git add -A ${destination}/$file + fi + fi +} + +function commit_changes_if_applicable() { + if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then + COMMIT_SUCCESSFUL="no" + git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes" + + # Uncomment the following push if you want to auto push to + # the gh-pages branch whenever you commit to master locally. + # This is a little extreme. Use with care! + ################################################################### + if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then + git push origin gh-pages + fi + fi +} + +# Switch back to the previous branch and exit block +function checkout_previous_branch() { + # If -version was provided we need to come back to root project + cd ${ROOT_FOLDER} + git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script" + if [ "$dirty" != "0" ]; then git stash pop; fi + exit 0 +} + +# Assert if properties have been properly passed +function assert_properties() { +echo "VERSION [${VERSION}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]" +if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi +if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi +if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi +} + +# Prints the usage +function print_usage() { +cat </` +- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will + switch to gh-pages of that repo and copy the generated docs to `docs//` + +USAGE: + +You can use the following options: + +-v|--version - the script will apply the whole procedure for a particular library version +-d|--destination - the root of destination folder where the docs should be copied. You have to use the full path. + E.g. point to spring-cloud-static folder. Can't be used with (-c) +-b|--build - will run the standard build process after checking out the branch +-c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination. + Obviously can't be used with (-d) + +EOF +} + + +# ========================================== +# ____ ____ _____ _____ _____ _______ +# / ____|/ ____| __ \|_ _| __ \__ __| +# | (___ | | | |__) | | | | |__) | | | +# \___ \| | | _ / | | | ___/ | | +# ____) | |____| | \ \ _| |_| | | | +# |_____/ \_____|_| \_\_____|_| |_| +# +# ========================================== + +while [[ $# > 0 ]] +do +key="$1" +case ${key} in + -v|--version) + VERSION="$2" + shift # past argument + ;; + -d|--destination) + DESTINATION="$2" + shift # past argument + ;; + -b|--build) + BUILD="yes" + ;; + -c|--clone) + CLONE="yes" + ;; + -h|--help) + print_usage + exit 0 + ;; + *) + echo "Invalid option: [$1]" + print_usage + exit 1 + ;; +esac +shift # past argument or value +done + +assert_properties +set_default_props +check_if_anything_to_sync +if [[ -z "${VERSION}" ]] ; then + retrieve_current_branch +else + switch_to_tag +fi +build_docs_if_applicable +retrieve_doc_properties +stash_changes +add_docs_from_target +checkout_previous_branch \ No newline at end of file diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-groups.png b/docs/src/main/asciidoc/images/SCSt-groups.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-groups.png rename to docs/src/main/asciidoc/images/SCSt-groups.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-overview.png b/docs/src/main/asciidoc/images/SCSt-overview.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-overview.png rename to docs/src/main/asciidoc/images/SCSt-overview.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-partitioning.png b/docs/src/main/asciidoc/images/SCSt-partitioning.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-partitioning.png rename to docs/src/main/asciidoc/images/SCSt-partitioning.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-sensors.png b/docs/src/main/asciidoc/images/SCSt-sensors.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-sensors.png rename to docs/src/main/asciidoc/images/SCSt-sensors.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-with-binder.png b/docs/src/main/asciidoc/images/SCSt-with-binder.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/SCSt-with-binder.png rename to docs/src/main/asciidoc/images/SCSt-with-binder.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/custom_vs_global_error_channels.png b/docs/src/main/asciidoc/images/custom_vs_global_error_channels.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/custom_vs_global_error_channels.png rename to docs/src/main/asciidoc/images/custom_vs_global_error_channels.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/producers-consumers.png b/docs/src/main/asciidoc/images/producers-consumers.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/producers-consumers.png rename to docs/src/main/asciidoc/images/producers-consumers.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/redis-binder.png b/docs/src/main/asciidoc/images/redis-binder.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/redis-binder.png rename to docs/src/main/asciidoc/images/redis-binder.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/registration.png b/docs/src/main/asciidoc/images/registration.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/registration.png rename to docs/src/main/asciidoc/images/registration.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/schema_reading.png b/docs/src/main/asciidoc/images/schema_reading.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/schema_reading.png rename to docs/src/main/asciidoc/images/schema_reading.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/schema_resolution.png b/docs/src/main/asciidoc/images/schema_resolution.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/schema_resolution.png rename to docs/src/main/asciidoc/images/schema_resolution.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/images/stream-initializr.png b/docs/src/main/asciidoc/images/stream-initializr.png similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/images/stream-initializr.png rename to docs/src/main/asciidoc/images/stream-initializr.png diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/preface.adoc b/docs/src/main/asciidoc/preface.adoc similarity index 100% rename from spring-cloud-stream-core-docs/src/main/asciidoc/preface.adoc rename to docs/src/main/asciidoc/preface.adoc diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/index.adoc b/docs/src/main/asciidoc/spring-cloud-stream.adoc similarity index 97% rename from spring-cloud-stream-core-docs/src/main/asciidoc/index.adoc rename to docs/src/main/asciidoc/spring-cloud-stream.adoc index 91504971a..4801aa2df 100644 --- a/spring-cloud-stream-core-docs/src/main/asciidoc/index.adoc +++ b/docs/src/main/asciidoc/spring-cloud-stream.adoc @@ -26,7 +26,7 @@ Sabby Anandan; Marius Bogoevici; Eric Bottard; Mark Fisher; Ilayaperumal Gopinat include::preface.adoc[] = Reference Guide -include::spring-cloud-stream-overview.adoc[] +include::README.adoc[] = Appendices diff --git a/docs/src/main/ruby/generate_readme.sh b/docs/src/main/ruby/generate_readme.sh new file mode 100755 index 000000000..6d0ce9dc5 --- /dev/null +++ b/docs/src/main/ruby/generate_readme.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby + +base_dir = File.join(File.dirname(__FILE__),'../../..') +src_dir = File.join(base_dir, "/src/main/asciidoc") +require 'asciidoctor' +require 'optparse' + +options = {} +file = "#{src_dir}/README.adoc" + +OptionParser.new do |o| + o.on('-o OUTPUT_FILE', 'Output file (default is stdout)') { |file| options[:to_file] = file unless file=='-' } + o.on('-h', '--help') { puts o; exit } + o.parse! +end + +file = ARGV[0] if ARGV.length>0 + +# Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/scripts/asciidoc-coalescer.rb +doc = Asciidoctor.load_file file, safe: :unsafe, header_only: true, attributes: options[:attributes] +header_attr_names = (doc.instance_variable_get :@attributes_modified).to_a +header_attr_names.each {|k| doc.attributes[%(#{k}!)] = '' unless doc.attr? k } +attrs = doc.attributes +attrs['allow-uri-read'] = true +puts attrs + +out = "// Do not edit this file (e.g. go instead to src/main/asciidoc)\n\n" +doc = Asciidoctor.load_file file, safe: :unsafe, parse: false, attributes: attrs +out << doc.reader.read + +unless options[:to_file] + puts out +else + File.open(options[:to_file],'w+') do |file| + file.write(out) + end +end diff --git a/eclipse/eclipse-code-formatter.xml b/eclipse/eclipse-code-formatter.xml deleted file mode 100644 index 8dc32870a..000000000 --- a/eclipse/eclipse-code-formatter.xml +++ /dev/null @@ -1,397 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eclipse/eclipse.importorder b/eclipse/eclipse.importorder deleted file mode 100644 index 080e73d9a..000000000 --- a/eclipse/eclipse.importorder +++ /dev/null @@ -1,7 +0,0 @@ -#Organize Import Order -#Wed Apr 26 12:53:22 EDT 2017 -4=\# -3=org.springframework -2= -1=javax -0=java diff --git a/pom.xml b/pom.xml index 3fe125e67..5dd3afde7 100644 --- a/pom.xml +++ b/pom.xml @@ -106,11 +106,11 @@ spring-cloud-stream-test-support spring-cloud-stream-test-support-internal spring-cloud-stream-integration-tests - spring-cloud-stream-core-docs spring-cloud-stream-reactive spring-cloud-stream-schema spring-cloud-stream-schema-server spring-cloud-stream-tools + docs diff --git a/spring-cloud-stream-core-docs/pom.xml b/spring-cloud-stream-core-docs/pom.xml deleted file mode 100644 index a5d6b98b6..000000000 --- a/spring-cloud-stream-core-docs/pom.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - 4.0.0 - - org.springframework.cloud - spring-cloud-stream-parent - 2.1.0.BUILD-SNAPSHOT - - spring-cloud-stream-core-docs - spring-cloud-stream-core-docs - Spring Cloud Stream Core Documentation - - ${basedir}/.. - - - - org.springframework.cloud - spring-cloud-stream - - - - - full - - - - org.codehaus.mojo - xml-maven-plugin - 1.0 - - - - transform - - - - - - - ${project.build.directory}/external-resources - src/main/xslt/dependencyVersions.xsl - - - .adoc - - - ${project.build.directory}/generated-resources - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - prepare-package - - true - - ${project.groupId}:* - - false - true - ${basedir}/src/main/javadoc/spring-javadoc.css - - http://docs.spring.io/spring-framework/docs/${spring.version}/javadoc-api/ - http://docs.spring.io/spring-shell/docs/current/api/ - - - - - - - org.asciidoctor - asciidoctor-maven-plugin - 1.5.3 - - - generate-docbook - generate-resources - - process-asciidoc - - - index.adoc - docbook5 - book - - true - ${project.version} - ${project.version} - ${github-tag} - ${spring-boot.version} - - - - - - - com.agilejava.docbkx - docbkx-maven-plugin - 2.0.15 - - ${basedir}/target/generated-docs - - 0 - index.xml - true - false - ${basedir}/src/main/docbook/xsl/pdf.xsl - 1 - 1 - 1 - ${basedir}/src/main/docbook/xsl/xslthl-config.xml - - - - - - - - - net.sf.xslthl - xslthl - 2.1.0 - - - net.sf.docbook - docbook-xml - 5.0-all - resources - zip - runtime - - - - - html-single - - generate-html - - generate-resources - - ${basedir}/src/main/docbook/xsl/html-singlepage.xsl - ${basedir}/target/docbook/htmlsingle - - - - - - - - - - - - - - - - - - - - - - - - - - - html - - generate-html - - generate-resources - - ${basedir}/src/main/docbook/xsl/html-multipage.xsl - ${basedir}/target/docbook/html - true - - - - - - - - - - - - - - - - - - - - - - - - - - - pdf - - generate-pdf - - generate-resources - - ${basedir}/src/main/docbook/xsl/pdf.xsl - ${basedir}/target/docbook/pdf - - - - - - - - - - - - epub - - generate-epub3 - - generate-resources - - ${basedir}/src/main/docbook/xsl/epub.xsl - ${basedir}/target/docbook/epub - - - - - - - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - org.apache.ant - ant-nodeps - 1.8.1 - - - org.tigris.antelope - antelopetasks - 3.2.10 - - - - - package-and-attach-docs-zip - package - - run - - - - - - - - - - - - setup-maven-properties - validate - - run - - - true - - - - - - - - - - - - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-zip - - attach-artifact - - - - - ${project.build.directory}/${project.artifactId}-${project.version}.zip - zip;zip.type=docs;zip.deployed=false - - - - - - - - - - - diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/.gitignore b/spring-cloud-stream-core-docs/src/main/asciidoc/.gitignore deleted file mode 100644 index bbc341117..000000000 --- a/spring-cloud-stream-core-docs/src/main/asciidoc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.html -*.css diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/Guardfile b/spring-cloud-stream-core-docs/src/main/asciidoc/Guardfile deleted file mode 100644 index bdd4d7298..000000000 --- a/spring-cloud-stream-core-docs/src/main/asciidoc/Guardfile +++ /dev/null @@ -1,20 +0,0 @@ -require 'asciidoctor' -require 'erb' - -guard 'shell' do - watch(/.*\.adoc$/) {|m| - Asciidoctor.render_file('index.adoc', \ - :in_place => true, \ - :safe => Asciidoctor::SafeMode::UNSAFE, \ - :attributes=> { \ - 'source-highlighter' => 'prettify', \ - 'icons' => 'font', \ - 'linkcss'=> 'true', \ - 'copycss' => 'true', \ - 'doctype' => 'book'}) - } -end - -guard 'livereload' do - watch(%r{^.+\.(css|js|html)$}) -end diff --git a/spring-cloud-stream-core-docs/src/main/asciidoc/index-docinfo.xml b/spring-cloud-stream-core-docs/src/main/asciidoc/index-docinfo.xml deleted file mode 100644 index fe0a9c9d8..000000000 --- a/spring-cloud-stream-core-docs/src/main/asciidoc/index-docinfo.xml +++ /dev/null @@ -1,14 +0,0 @@ -Spring Cloud Stream -{spring-cloud-stream-version} - - 2013-2018 - Pivotal Software, Inc. - - - - Copies of this document may be made for your own use and for distribution to - others, provided that you do not charge any fee for such copies and further - provided that each copy contains this Copyright Notice, whether distributed in - print or electronically. - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/css/highlight.css b/spring-cloud-stream-core-docs/src/main/docbook/css/highlight.css deleted file mode 100644 index ffefef72d..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/css/highlight.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - code highlight CSS resemblign the Eclipse IDE default color schema - @author Costin Leau -*/ - -.hl-keyword { - color: #7F0055; - font-weight: bold; -} - -.hl-comment { - color: #3F5F5F; - font-style: italic; -} - -.hl-multiline-comment { - color: #3F5FBF; - font-style: italic; -} - -.hl-tag { - color: #3F7F7F; -} - -.hl-attribute { - color: #7F007F; -} - -.hl-value { - color: #2A00FF; -} - -.hl-string { - color: #2A00FF; -} \ No newline at end of file diff --git a/spring-cloud-stream-core-docs/src/main/docbook/css/manual-multipage.css b/spring-cloud-stream-core-docs/src/main/docbook/css/manual-multipage.css deleted file mode 100644 index 0c484531c..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/css/manual-multipage.css +++ /dev/null @@ -1,9 +0,0 @@ -@IMPORT url("manual.css"); - -body.firstpage { - background: url("../images/background.png") no-repeat center top; -} - -div.part h1 { - border-top: none; -} diff --git a/spring-cloud-stream-core-docs/src/main/docbook/css/manual-singlepage.css b/spring-cloud-stream-core-docs/src/main/docbook/css/manual-singlepage.css deleted file mode 100644 index 4a7fd1400..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/css/manual-singlepage.css +++ /dev/null @@ -1,6 +0,0 @@ -@IMPORT url("manual.css"); - -body { - background: url("../images/background.png") no-repeat center top; -} - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/css/manual.css b/spring-cloud-stream-core-docs/src/main/docbook/css/manual.css deleted file mode 100644 index 0ecbe2e88..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/css/manual.css +++ /dev/null @@ -1,344 +0,0 @@ -@IMPORT url("highlight.css"); - -html { - padding: 0pt; - margin: 0pt; -} - -body { - color: #333333; - margin: 15px 30px; - font-family: Helvetica, Arial, Freesans, Clean, Sans-serif; - line-height: 1.6; - -webkit-font-smoothing: antialiased; -} - -code { - font-size: 16px; - font-family: Consolas, "Liberation Mono", Courier, monospace; -} - -:not(a)>code { - color: #6D180B; -} - -:not(pre)>code { - background-color: #F2F2F2; - border: 1px solid #CCCCCC; - border-radius: 4px; - padding: 1px 3px 0; - text-shadow: none; - white-space: nowrap; -} - -body>*:first-child { - margin-top: 0 !important; -} - -div { - margin: 0pt; -} - -hr { - border: 1px solid #CCCCCC; - background: #CCCCCC; -} - -h1,h2,h3,h4,h5,h6 { - color: #000000; - cursor: text; - font-weight: bold; - margin: 30px 0 10px; - padding: 0; -} - -h1,h2,h3 { - margin: 40px 0 10px; -} - -h1 { - margin: 70px 0 30px; - padding-top: 20px; -} - -div.part h1 { - border-top: 1px dotted #CCCCCC; -} - -h1,h1 code { - font-size: 32px; -} - -h2,h2 code { - font-size: 24px; -} - -h3,h3 code { - font-size: 20px; -} - -h4,h1 code,h5,h5 code,h6,h6 code { - font-size: 18px; -} - -div.book,div.chapter,div.appendix,div.part,div.preface { - min-width: 300px; - max-width: 1200px; - margin: 0 auto; -} - -p.releaseinfo { - font-weight: bold; - margin-bottom: 40px; - margin-top: 40px; -} - -div.authorgroup { - line-height: 1; -} - -p.copyright { - line-height: 1; - margin-bottom: -5px; -} - -.legalnotice p { - font-style: italic; - font-size: 14px; - line-height: 1; -} - -div.titlepage+p,div.titlepage+p { - margin-top: 0; -} - -pre { - line-height: 1.0; - color: black; -} - -a { - color: #4183C4; - text-decoration: none; -} - -p { - margin: 15px 0; - text-align: left; -} - -ul,ol { - padding-left: 30px; -} - -li p { - margin: 0; -} - -div.table { - margin: 1em; - padding: 0.5em; - text-align: center; -} - -div.table table,div.informaltable table { - display: table; - width: 100%; -} - -div.table td { - padding-left: 7px; - padding-right: 7px; -} - -.sidebar { - line-height: 1.4; - padding: 0 20px; - background-color: #F8F8F8; - border: 1px solid #CCCCCC; - border-radius: 3px 3px 3px 3px; -} - -.sidebar p.title { - color: #6D180B; -} - -pre.programlisting,pre.screen { - font-size: 15px; - padding: 6px 10px; - background-color: #F8F8F8; - border: 1px solid #CCCCCC; - border-radius: 3px 3px 3px 3px; - clear: both; - overflow: auto; - line-height: 1.4; - font-family: Consolas, "Liberation Mono", Courier, monospace; -} - -table { - border-collapse: collapse; - border-spacing: 0; - border: 1px solid #DDDDDD !important; - border-radius: 4px !important; - border-collapse: separate !important; - line-height: 1.6; -} - -table thead { - background: #F5F5F5; -} - -table tr { - border: none; - border-bottom: none; -} - -table th { - font-weight: bold; -} - -table th,table td { - border: none !important; - padding: 6px 13px; -} - -table tr:nth-child(2n) { - background-color: #F8F8F8; -} - -td p { - margin: 0 0 15px 0; -} - -div.table-contents td p { - margin: 0; -} - -div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist * - { - border: none !important; - background: none !important; - margin: 0; -} - -div.important p,div.note p,div.tip p,div.warning p { - color: #6F6F6F; - line-height: 1.6; -} - -div.important code,div.note code,div.tip code,div.warning code { - background-color: #F2F2F2 !important; - border: 1px solid #CCCCCC !important; - border-radius: 4px !important; - padding: 1px 3px 0 !important; - text-shadow: none !important; - white-space: nowrap !important; -} - -.note th,.tip th,.warning th { - display: none; -} - -.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td - { - border-right: 1px solid #CCCCCC !important; - padding-top: 10px; -} - -div.calloutlist p,div.calloutlist td { - padding: 0; - margin: 0; -} - -div.calloutlist>table>tbody>tr>td:first-child { - padding-left: 10px; - width: 30px !important; -} - -div.important,div.note,div.tip,div.warning { - margin-left: 0px !important; - margin-right: 20px !important; - margin-top: 20px; - margin-bottom: 20px; - padding-top: 10px; - padding-bottom: 10px; -} - -div.toc { - line-height: 1.2; -} - -dl,dt { - margin-top: 1px; - margin-bottom: 0; -} - -div.toc>dl>dt { - font-size: 32px; - font-weight: bold; - margin: 30px 0 10px 0; - display: block; -} - -div.toc>dl>dd>dl>dt { - font-size: 24px; - font-weight: bold; - margin: 20px 0 10px 0; - display: block; -} - -div.toc>dl>dd>dl>dd>dl>dt { - font-weight: bold; - font-size: 20px; - margin: 10px 0 0 0; -} - -tbody.footnotes * { - border: none !important; -} - -div.footnote p { - margin: 0; - line-height: 1; -} - -div.footnote p sup { - margin-right: 6px; - vertical-align: middle; -} - -div.navheader { - border-bottom: 1px solid #CCCCCC; -} - -div.navfooter { - border-top: 1px solid #CCCCCC; -} - -.title { - margin-left: -1em; - padding-left: 1em; -} - -.title>a { - position: absolute; - visibility: hidden; - display: block; - font-size: 0.85em; - margin-top: 0.05em; - margin-left: -1em; - vertical-align: text-top; - color: black; -} - -.title>a:before { - content: "\00A7"; -} - -.title:hover>a,.title>a:hover,.title:hover>a:hover { - visibility: visible; -} - -.title:focus>a,.title>a:focus,.title:focus>a:focus { - outline: 0; -} diff --git a/spring-cloud-stream-core-docs/src/main/docbook/images/background.png b/spring-cloud-stream-core-docs/src/main/docbook/images/background.png deleted file mode 100644 index d4195e5b3..000000000 Binary files a/spring-cloud-stream-core-docs/src/main/docbook/images/background.png and /dev/null differ diff --git a/spring-cloud-stream-core-docs/src/main/docbook/images/caution.png b/spring-cloud-stream-core-docs/src/main/docbook/images/caution.png deleted file mode 100644 index 8a5e4fca0..000000000 Binary files a/spring-cloud-stream-core-docs/src/main/docbook/images/caution.png and /dev/null differ diff --git a/spring-cloud-stream-core-docs/src/main/docbook/images/important.png b/spring-cloud-stream-core-docs/src/main/docbook/images/important.png deleted file mode 100644 index ec54df65c..000000000 Binary files a/spring-cloud-stream-core-docs/src/main/docbook/images/important.png and /dev/null differ diff --git a/spring-cloud-stream-core-docs/src/main/docbook/images/logo.png b/spring-cloud-stream-core-docs/src/main/docbook/images/logo.png deleted file mode 100644 index 45f1978f3..000000000 Binary files a/spring-cloud-stream-core-docs/src/main/docbook/images/logo.png and /dev/null differ diff --git a/spring-cloud-stream-core-docs/src/main/docbook/images/note.png b/spring-cloud-stream-core-docs/src/main/docbook/images/note.png deleted file mode 100644 index 88d997b17..000000000 Binary files a/spring-cloud-stream-core-docs/src/main/docbook/images/note.png and /dev/null differ diff --git a/spring-cloud-stream-core-docs/src/main/docbook/images/tip.png b/spring-cloud-stream-core-docs/src/main/docbook/images/tip.png deleted file mode 100644 index 6530abb4b..000000000 Binary files a/spring-cloud-stream-core-docs/src/main/docbook/images/tip.png and /dev/null differ diff --git a/spring-cloud-stream-core-docs/src/main/docbook/images/warning.png b/spring-cloud-stream-core-docs/src/main/docbook/images/warning.png deleted file mode 100644 index 0d5b52446..000000000 Binary files a/spring-cloud-stream-core-docs/src/main/docbook/images/warning.png and /dev/null differ diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/common.xsl b/spring-cloud-stream-core-docs/src/main/docbook/xsl/common.xsl deleted file mode 100644 index 157bf9d85..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/common.xsl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - 1 - 0 - 1 - - - - images/ - .png - - - book toc,title - 3 - - - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/epub.xsl b/spring-cloud-stream-core-docs/src/main/docbook/xsl/epub.xsl deleted file mode 100644 index 031406ca4..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/epub.xsl +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/html-multipage.xsl b/spring-cloud-stream-core-docs/src/main/docbook/xsl/html-multipage.xsl deleted file mode 100644 index be9cc52de..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/html-multipage.xsl +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - css/manual-multipage.css - - '5' - '1' - - - - - - - - - - - - - - - - - - - - firstpage - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/html-singlepage.xsl b/spring-cloud-stream-core-docs/src/main/docbook/xsl/html-singlepage.xsl deleted file mode 100644 index 6bd4ac819..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/html-singlepage.xsl +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - css/manual-singlepage.css - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/html.xsl b/spring-cloud-stream-core-docs/src/main/docbook/xsl/html.xsl deleted file mode 100644 index fd96f9a70..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/html.xsl +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - 1 - - - 1 - - - - 120 - images/callouts/ - .png - - - text/css - - text-align: left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - -
-

Authors

- -
-
- - - - - - - - - - - - - - - - - # - - - - - - -
diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/pdf.xsl b/spring-cloud-stream-core-docs/src/main/docbook/xsl/pdf.xsl deleted file mode 100644 index 21fc4a10a..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/pdf.xsl +++ /dev/null @@ -1,591 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - auto - - - - - underline - #204060 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - Copyright © - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -5em - -5em - 8pt - - - - - - - - - - - - - - - please define title in your docbook file! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8pt - - - - - - - - - - - - - - - - - - - - - - - - - please define title in your docbook file! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 0 - 0 - - - - false - - - Helvetica - 10 - 8 - Helvetica - - - 1.4 - - - - left - bold - - - pt - - - - - - - - - - - - - - - 0.6em - 0.6em - 0.6em - - - pt - - 0.1em - 0.1em - 0.1em - - - - 0.4em - 0.4em - 0.4em - - - pt - - 0.1em - 0.1em - 0.1em - - - - 0.4em - 0.4em - 0.4em - - - pt - - 0.1em - 0.1em - 0.1em - - - - 0.3em - 0.3em - 0.3em - - - pt - - 0.1em - 0.1em - 0.1em - - - - - - - - 4pt - 4pt - 4pt - 4pt - - - - 0.1pt - 0.1pt - - - - - - - - - - - - - - - - 7pt - wrap - 1 - - - - 1em - 1em - 1em - 0.1em - 0.1em - 0.1em - - #444444 - solid - 0.1pt - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - - - - 1 - - #F0F0F0 - - - - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - - - - 0.5em - 0.5em - 0.5em - 0.1em - 0.1em - 0.1em - - - - #444444 - solid - 0.1pt - #F0F0F0 - - - - - - - normal - italic - - - pt - - false - 0.1em - 0.1em - 0.1em - - - - - - 0 - 1 - - - 90 - - - - - - figure after - example after - equation before - table before - procedure before - - - - 1 - 0pt - - - - - - - - - - - - - - - - - - - - 18pt - - - - 0.1em - 2em - .75pt - solid - #5c5c4f - 0.5em - 1.5em - 1.5em - 1.5em - 1.5em - 1.5em - 1.5em - - - - 10pt - bold - false - always - 0 - - - - 0em - 0em - 0em - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl-config.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl-config.xml deleted file mode 100644 index e4d677fc5..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl-config.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/asciidoc-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/asciidoc-hl.xml deleted file mode 100644 index 5478b1d6d..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/asciidoc-hl.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - //// - //// - - - // - - - - ^(={1,6} .+)$ - - MULTILINE - - - ^(\.[^\.\s].+)$ - - MULTILINE - - - ^(:!?\w.*?:) - - MULTILINE - - - ^(-|\*{1,5}|\d*\.{1,5})(?= .+$) - - MULTILINE - - - ^(\[.+\])$ - - MULTILINE - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/bourne-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/bourne-hl.xml deleted file mode 100644 index e2cd98d8b..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/bourne-hl.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - # - - << - ' - " - - - - - - - " - \ - - - ' - \ - - - - 0x - - - - . - - - - - - if - then - else - elif - fi - case - esac - for - while - until - do - done - - exec - shift - exit - times - break - export - trap - continue - readonly - wait - eval - return - - cd - echo - hash - pwd - read - set - test - type - ulimit - umask - unset - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/c-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/c-hl.xml deleted file mode 100644 index 176cc379f..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/c-hl.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - /** - */ - - - - - - - - /* - */ - - // - - - # - \ - - - - - " - \ - - - ' - \ - - - 0x - ul - lu - u - l - - - - . - - e - ul - lu - u - f - l - - - - auto - _Bool - break - case - char - _Complex - const - continue - default - do - double - else - enum - extern - float - for - goto - if - _Imaginary - inline - int - long - register - restrict - return - short - signed - sizeof - static - struct - switch - typedef - union - unsigned - void - volatile - while - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/cpp-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/cpp-hl.xml deleted file mode 100644 index ef83c4f5e..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/cpp-hl.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - /** - */ - - - - - - - - /* - */ - - // - - - # - \ - - - - - " - \ - - - ' - \ - - - 0x - ul - lu - u - l - - - - . - - e - ul - lu - u - f - l - - - - - auto - _Bool - break - case - char - _Complex - const - continue - default - do - double - else - enum - extern - float - for - goto - if - _Imaginary - inline - int - long - register - restrict - return - short - signed - sizeof - static - struct - switch - typedef - union - unsigned - void - volatile - while - - asm - dynamic_cast - namespace - reinterpret_cast - try - bool - explicit - new - static_cast - typeid - catch - false - operator - template - typename - class - friend - private - this - using - const_cast - inline - public - throw - virtual - delete - mutable - protected - true - wchar_t - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/csharp-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/csharp-hl.xml deleted file mode 100644 index d57e63102..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/csharp-hl.xml +++ /dev/null @@ -1,194 +0,0 @@ - - - - - /** - */ - - - - /// - - - - /* - */ - - // - - - [ - ] - ( - ) - - - - # - \ - - - - - - @" - " - \ - - - - " - \ - - - ' - \ - - - 0x - ul - lu - u - l - - - - . - - e - ul - lu - u - f - d - m - l - - - - abstract - as - base - bool - break - byte - case - catch - char - checked - class - const - continue - decimal - default - delegate - do - double - else - enum - event - explicit - extern - false - finally - fixed - float - for - foreach - goto - if - implicit - in - int - interface - internal - is - lock - long - namespace - new - null - object - operator - out - override - params - private - protected - public - readonly - ref - return - sbyte - sealed - short - sizeof - stackalloc - static - string - struct - switch - this - throw - true - try - typeof - uint - ulong - unchecked - unsafe - ushort - using - virtual - void - volatile - while - - - - add - alias - from - get - global - group - into - join - orderby - partial - remove - select - set - value - where - yield - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/css-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/css-hl.xml deleted file mode 100644 index 164c48c3d..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/css-hl.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - /* - */ - - - " - \ - - - - ' - \ - - - - . - - - - @charset - @import - @media - @page - - - - - - azimuth - background-attachment - background-color - background-image - background-position - background-repeat - background - border-collapse - border-color - border-spacing - border-style - border-top - border-right - border-bottom - border-left - border-top-color - border-right-color - border-bottom-color - border-left-color - border-top-style - border-right-style - border-bottom-style - border-left-style - border-top-width - border-right-width - border-bottom-width - border-left-width - border-width - border - bottom - caption-side - clear - clip - color - content - counter-increment - counter-reset - cue-after - cue-before - cue - cursor - direction - display - elevation - empty-cells - float - font-family - font-size - font-style - font-variant - font-weight - font - height - left - letter-spacing - line-height - list-style-image - list-style-position - list-style-type - list-style - margin-right - margin-left - margin-top - margin-bottom - margin - max-height - max-width - min-height - min-width - orphans - outline-color - outline-style - outline-width - outline - overflow - padding-top - padding-right - padding-bottom - padding-left - padding - page-break-after - page-break-before - page-break-inside - pause-after - pause-before - pause - pitch-range - pitch - play-during - position - quotes - richness - right - speak-header - speak-numeral - speak-punctuation - speak - speech-rate - stress - table-layout - text-align - text-decoration - text-indent - text-transform - top - unicode-bidi - vertical-align - visibility - voice-family - volume - white-space - widows - width - word-spacing - z-index - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/html-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/html-hl.xml deleted file mode 100644 index 5b6761bab..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/html-hl.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - a - abbr - address - area - article - aside - audio - b - base - bdi - blockquote - body - br - button - caption - canvas - cite - code - command - col - colgroup - dd - del - dialog - div - dl - dt - em - embed - fieldset - figcaption - figure - font - form - footer - h1 - h2 - h3 - h4 - h5 - h6 - head - header - hr - html - i - iframe - img - input - ins - kbd - label - legend - li - link - map - mark - menu - menu - meta - nav - noscript - object - ol - optgroup - option - p - param - pre - q - samp - script - section - select - small - source - span - strong - style - sub - summary - sup - table - tbody - td - textarea - tfoot - th - thead - time - title - tr - track - u - ul - var - video - wbr - xmp - - - - - xsl: - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/ini-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/ini-hl.xml deleted file mode 100644 index 34c103637..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/ini-hl.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - ; - - - ^(\[.+\]\s*)$ - - MULTILINE - - - - ^(.+)(?==) - - MULTILINE - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/java-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/java-hl.xml deleted file mode 100644 index f7bb16414..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/java-hl.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - /** - */ - - - - /* - */ - - // - - " - \ - - - ' - \ - - - @ - ( - ) - - - 0x - - - - . - e - f - d - l - - - - abstract - boolean - break - byte - case - catch - char - class - const - continue - default - do - double - else - extends - final - finally - float - for - goto - if - implements - import - instanceof - int - interface - long - native - new - package - private - protected - public - return - short - static - strictfp - super - switch - synchronized - this - throw - throws - transient - try - void - volatile - while - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/javascript-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/javascript-hl.xml deleted file mode 100644 index 99b8a71e9..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/javascript-hl.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - /* - */ - - // - - " - \ - - - ' - \ - - - 0x - - - - . - e - - - - break - case - catch - continue - default - delete - do - else - finally - for - function - if - in - instanceof - new - return - switch - this - throw - try - typeof - var - void - while - with - - abstract - boolean - byte - char - class - const - debugger - double - enum - export - extends - final - float - goto - implements - import - int - interface - long - native - package - private - protected - public - short - static - super - synchronized - throws - transient - volatile - - - prototype - - Array - Boolean - Date - Error - EvalError - Function - Math - Number - Object - RangeError - ReferenceError - RegExp - String - SyntaxError - TypeError - URIError - - decodeURI - decodeURIComponent - encodeURI - encodeURIComponent - eval - isFinite - isNaN - parseFloat - parseInt - - Infinity - NaN - undefined - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/json-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/json-hl.xml deleted file mode 100644 index 59b9c4811..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/json-hl.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - # - - " - \ - - - ' - \ - - - @ - ( - ) - - - . - e - f - d - l - - - - true - false - - - { - } - , - [ - ] - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/perl-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/perl-hl.xml deleted file mode 100644 index 73d71cc02..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/perl-hl.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - # - - << - ' - " - - - - " - \ - - - ' - \ - - - - 0x - - - - . - - - - - if - unless - while - until - foreach - else - elsif - for - when - default - given - - caller - continue - die - do - dump - eval - exit - goto - last - next - redo - return - sub - wantarray - - caller - import - local - my - package - use - - do - import - no - package - require - use - - bless - dbmclose - dbmopen - package - ref - tie - tied - untie - use - - and - or - not - eq - ne - lt - gt - le - ge - cmp - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/php-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/php-hl.xml deleted file mode 100644 index 1da25b8cc..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/php-hl.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - /** - */ - - - - - - - - /* - */ - - // - # - - " - \ - - - - ' - \ - - - - <<< - - - 0x - - - - . - e - - - - and - or - xor - __FILE__ - exception - __LINE__ - array - as - break - case - class - const - continue - declare - default - die - do - echo - else - elseif - empty - enddeclare - endfor - endforeach - endif - endswitch - endwhile - eval - exit - extends - for - foreach - function - global - if - include - include_once - isset - list - new - print - require - require_once - return - static - switch - unset - use - var - while - __FUNCTION__ - __CLASS__ - __METHOD__ - final - php_user_filter - interface - implements - extends - public - private - protected - abstract - clone - try - catch - throw - cfunction - old_function - true - false - - namespace - __NAMESPACE__ - goto - __DIR__ - - - - - ?> - <?php - <?= - - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/properties-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/properties-hl.xml deleted file mode 100644 index 775f2f13e..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/properties-hl.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - # - - ^(.+?)(?==|:) - - MULTILINE - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/python-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/python-hl.xml deleted file mode 100644 index a46744323..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/python-hl.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - @ - ( - ) - - # - - """ - - - - ''' - - - - " - \ - - - ' - \ - - - 0x - l - - - - . - - e - l - - - - and - del - from - not - while - as - elif - global - or - with - assert - else - if - pass - yield - break - except - import - print - class - exec - in - raise - continue - finally - is - return - def - for - lambda - try - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/ruby-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/ruby-hl.xml deleted file mode 100644 index d105640e8..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/ruby-hl.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - # - - << - - - - " - \ - - - %Q{ - } - \ - - - %/ - / - \ - - - ' - \ - - - %q{ - } - \ - - - 0x - - - - . - e - - - - alias - and - BEGIN - begin - break - case - class - def - defined - do - else - elsif - END - end - ensure - false - for - if - in - module - next - nil - not - or - redo - rescue - retry - return - self - super - then - true - undef - unless - until - when - while - yield - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/sql2003-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/sql2003-hl.xml deleted file mode 100644 index ac1d5d048..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/sql2003-hl.xml +++ /dev/null @@ -1,565 +0,0 @@ - - - - -- - - /* - */ - - - ' - - - - U' - ' - - - - B' - ' - - - - N' - ' - - - - X' - ' - - - - . - - e - - - - - - A - ABS - ABSOLUTE - ACTION - ADA - ADMIN - AFTER - ALWAYS - ASC - ASSERTION - ASSIGNMENT - ATTRIBUTE - ATTRIBUTES - AVG - BEFORE - BERNOULLI - BREADTH - C - CARDINALITY - CASCADE - CATALOG_NAME - CATALOG - CEIL - CEILING - CHAIN - CHAR_LENGTH - CHARACTER_LENGTH - CHARACTER_SET_CATALOG - CHARACTER_SET_NAME - CHARACTER_SET_SCHEMA - CHARACTERISTICS - CHARACTERS - CHECKED - CLASS_ORIGIN - COALESCE - COBOL - CODE_UNITS - COLLATION_CATALOG - COLLATION_NAME - COLLATION_SCHEMA - COLLATION - COLLECT - COLUMN_NAME - COMMAND_FUNCTION_CODE - COMMAND_FUNCTION - COMMITTED - CONDITION_NUMBER - CONDITION - CONNECTION_NAME - CONSTRAINT_CATALOG - CONSTRAINT_NAME - CONSTRAINT_SCHEMA - CONSTRAINTS - CONSTRUCTORS - CONTAINS - CONVERT - CORR - COUNT - COVAR_POP - COVAR_SAMP - CUME_DIST - CURRENT_COLLATION - CURSOR_NAME - DATA - DATETIME_INTERVAL_CODE - DATETIME_INTERVAL_PRECISION - DEFAULTS - DEFERRABLE - DEFERRED - DEFINED - DEFINER - DEGREE - DENSE_RANK - DEPTH - DERIVED - DESC - DESCRIPTOR - DIAGNOSTICS - DISPATCH - DOMAIN - DYNAMIC_FUNCTION_CODE - DYNAMIC_FUNCTION - EQUALS - EVERY - EXCEPTION - EXCLUDE - EXCLUDING - EXP - EXTRACT - FINAL - FIRST - FLOOR - FOLLOWING - FORTRAN - FOUND - FUSION - G - GENERAL - GO - GOTO - GRANTED - HIERARCHY - IMPLEMENTATION - INCLUDING - INCREMENT - INITIALLY - INSTANCE - INSTANTIABLE - INTERSECTION - INVOKER - ISOLATION - K - KEY_MEMBER - KEY_TYPE - KEY - LAST - LENGTH - LEVEL - LN - LOCATOR - LOWER - M - MAP - MATCHED - MAX - MAXVALUE - MESSAGE_LENGTH - MESSAGE_OCTET_LENGTH - MESSAGE_TEXT - MIN - MINVALUE - MOD - MORE - MUMPS - NAME - NAMES - NESTING - NEXT - NORMALIZE - NORMALIZED - NULLABLE - NULLIF - NULLS - NUMBER - OBJECT - OCTET_LENGTH - OCTETS - OPTION - OPTIONS - ORDERING - ORDINALITY - OTHERS - OVERLAY - OVERRIDING - PAD - PARAMETER_MODE - PARAMETER_NAME - PARAMETER_ORDINAL_POSITION - PARAMETER_SPECIFIC_CATALOG - PARAMETER_SPECIFIC_NAME - PARAMETER_SPECIFIC_SCHEMA - PARTIAL - PASCAL - PATH - PERCENT_RANK - PERCENTILE_CONT - PERCENTILE_DISC - PLACING - PLI - POSITION - POWER - PRECEDING - PRESERVE - PRIOR - PRIVILEGES - PUBLIC - RANK - READ - RELATIVE - REPEATABLE - RESTART - RETURNED_CARDINALITY - RETURNED_LENGTH - RETURNED_OCTET_LENGTH - RETURNED_SQLSTATE - ROLE - ROUTINE_CATALOG - ROUTINE_NAME - ROUTINE_SCHEMA - ROUTINE - ROW_COUNT - ROW_NUMBER - SCALE - SCHEMA_NAME - SCHEMA - SCOPE_CATALOG - SCOPE_NAME - SCOPE_SCHEMA - SECTION - SECURITY - SELF - SEQUENCE - SERIALIZABLE - SERVER_NAME - SESSION - SETS - SIMPLE - SIZE - SOURCE - SPACE - SPECIFIC_NAME - SQRT - STATE - STATEMENT - STDDEV_POP - STDDEV_SAMP - STRUCTURE - STYLE - SUBCLASS_ORIGIN - SUBSTRING - SUM - TABLE_NAME - TABLESAMPLE - TEMPORARY - TIES - TOP_LEVEL_COUNT - TRANSACTION_ACTIVE - TRANSACTION - TRANSACTIONS_COMMITTED - TRANSACTIONS_ROLLED_BACK - TRANSFORM - TRANSFORMS - TRANSLATE - TRIGGER_CATALOG - TRIGGER_NAME - TRIGGER_SCHEMA - TRIM - TYPE - UNBOUNDED - UNCOMMITTED - UNDER - UNNAMED - USAGE - USER_DEFINED_TYPE_CATALOG - USER_DEFINED_TYPE_CODE - USER_DEFINED_TYPE_NAME - USER_DEFINED_TYPE_SCHEMA - VIEW - WORK - WRITE - ZONE - - ADD - ALL - ALLOCATE - ALTER - AND - ANY - ARE - ARRAY - AS - ASENSITIVE - ASYMMETRIC - AT - ATOMIC - AUTHORIZATION - BEGIN - BETWEEN - BIGINT - BINARY - BLOB - BOOLEAN - BOTH - BY - CALL - CALLED - CASCADED - CASE - CAST - CHAR - CHARACTER - CHECK - CLOB - CLOSE - COLLATE - COLUMN - COMMIT - CONNECT - CONSTRAINT - CONTINUE - CORRESPONDING - CREATE - CROSS - CUBE - CURRENT_DATE - CURRENT_DEFAULT_TRANSFORM_GROUP - CURRENT_PATH - CURRENT_ROLE - CURRENT_TIME - CURRENT_TIMESTAMP - CURRENT_TRANSFORM_GROUP_FOR_TYPE - CURRENT_USER - CURRENT - CURSOR - CYCLE - DATE - DAY - DEALLOCATE - DEC - DECIMAL - DECLARE - DEFAULT - DELETE - DEREF - DESCRIBE - DETERMINISTIC - DISCONNECT - DISTINCT - DOUBLE - DROP - DYNAMIC - EACH - ELEMENT - ELSE - END - END-EXEC - ESCAPE - EXCEPT - EXEC - EXECUTE - EXISTS - EXTERNAL - FALSE - FETCH - FILTER - FLOAT - FOR - FOREIGN - FREE - FROM - FULL - FUNCTION - GET - GLOBAL - GRANT - GROUP - GROUPING - HAVING - HOLD - HOUR - IDENTITY - IMMEDIATE - IN - INDICATOR - INNER - INOUT - INPUT - INSENSITIVE - INSERT - INT - INTEGER - INTERSECT - INTERVAL - INTO - IS - ISOLATION - JOIN - LANGUAGE - LARGE - LATERAL - LEADING - LEFT - LIKE - LOCAL - LOCALTIME - LOCALTIMESTAMP - MATCH - MEMBER - MERGE - METHOD - MINUTE - MODIFIES - MODULE - MONTH - MULTISET - NATIONAL - NATURAL - NCHAR - NCLOB - NEW - NO - NONE - NOT - NULL - NUMERIC - OF - OLD - ON - ONLY - OPEN - OR - ORDER - OUT - OUTER - OUTPUT - OVER - OVERLAPS - PARAMETER - PARTITION - PRECISION - PREPARE - PRIMARY - PROCEDURE - RANGE - READS - REAL - RECURSIVE - REF - REFERENCES - REFERENCING - REGR_AVGX - REGR_AVGY - REGR_COUNT - REGR_INTERCEPT - REGR_R2 - REGR_SLOPE - REGR_SXX - REGR_SXY - REGR_SYY - RELEASE - RESULT - RETURN - RETURNS - REVOKE - RIGHT - ROLLBACK - ROLLUP - ROW - ROWS - SAVEPOINT - SCROLL - SEARCH - SECOND - SELECT - SENSITIVE - SESSION_USER - SET - SIMILAR - SMALLINT - SOME - SPECIFIC - SPECIFICTYPE - SQL - SQLEXCEPTION - SQLSTATE - SQLWARNING - START - STATIC - SUBMULTISET - SYMMETRIC - SYSTEM_USER - SYSTEM - TABLE - THEN - TIME - TIMESTAMP - TIMEZONE_HOUR - TIMEZONE_MINUTE - TO - TRAILING - TRANSLATION - TREAT - TRIGGER - TRUE - UESCAPE - UNION - UNIQUE - UNKNOWN - UNNEST - UPDATE - UPPER - USER - USING - VALUE - VALUES - VAR_POP - VAR_SAMP - VARCHAR - VARYING - WHEN - WHENEVER - WHERE - WIDTH_BUCKET - WINDOW - WITH - WITHIN - WITHOUT - YEAR - - diff --git a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/yaml-hl.xml b/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/yaml-hl.xml deleted file mode 100644 index a28008ec8..000000000 --- a/spring-cloud-stream-core-docs/src/main/docbook/xsl/xslthl/yaml-hl.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - # - - " - \ - - - ' - \ - - - @ - ( - ) - - - . - e - f - d - l - - - - true - false - - - { - } - , - [ - ] - - - - ^(---)$ - - MULTILINE - - - ^(.+?)(?==|:) - - MULTILINE - - diff --git a/spring-cloud-stream-core-docs/src/main/javadoc/spring-javadoc.css b/spring-cloud-stream-core-docs/src/main/javadoc/spring-javadoc.css deleted file mode 100644 index 06ad42277..000000000 --- a/spring-cloud-stream-core-docs/src/main/javadoc/spring-javadoc.css +++ /dev/null @@ -1,599 +0,0 @@ -/* Javadoc style sheet */ -/* -Overall document style -*/ - -@import url('resources/fonts/dejavu.css'); - -body { - background-color:#ffffff; - color:#353833; - font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; - font-size:14px; - margin:0; -} -a:link, a:visited { - text-decoration:none; - color:#4A6782; -} -a:hover, a:focus { - text-decoration:none; - color:#bb7a2a; -} -a:active { - text-decoration:none; - color:#4A6782; -} -a[name] { - color:#353833; -} -a[name]:hover { - text-decoration:none; - color:#353833; -} -pre { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; -} -h1 { - font-size:20px; -} -h2 { - font-size:18px; -} -h3 { - font-size:16px; - font-style:italic; -} -h4 { - font-size:13px; -} -h5 { - font-size:12px; -} -h6 { - font-size:11px; -} -ul { - list-style-type:disc; -} -code, tt { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - padding-top:4px; - margin-top:8px; - line-height:1.4em; -} -dt code { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - padding-top:4px; -} -table tr td dt code { - font-family:'DejaVu Sans Mono', monospace; - font-size:14px; - vertical-align:top; - padding-top:4px; -} -sup { - font-size:8px; -} -/* -Document title and Copyright styles -*/ -.clear { - clear:both; - height:0px; - overflow:hidden; -} -.aboutLanguage { - float:right; - padding:0px 21px; - font-size:11px; - z-index:200; - margin-top:-9px; -} -.legalCopy { - margin-left:.5em; -} -.bar a, .bar a:link, .bar a:visited, .bar a:active { - color:#FFFFFF; - text-decoration:none; -} -.bar a:hover, .bar a:focus { - color:#bb7a2a; -} -.tab { - background-color:#0066FF; - color:#ffffff; - padding:8px; - width:5em; - font-weight:bold; -} -/* -Navigation bar styles -*/ -.bar { - background-color:#4D7A97; - color:#FFFFFF; - padding:.8em .5em .4em .8em; - height:auto;/*height:1.8em;*/ - font-size:11px; - margin:0; -} -.topNav { - background-color:#4D7A97; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; - font-size:12px; -} -.bottomNav { - margin-top:10px; - background-color:#4D7A97; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; - font-size:12px; -} -.subNav { - background-color:#dee3e9; - float:left; - width:100%; - overflow:hidden; - font-size:12px; -} -.subNav div { - clear:left; - float:left; - padding:0 0 5px 6px; - text-transform:uppercase; -} -ul.navList, ul.subNavList { - float:left; - margin:0 25px 0 0; - padding:0; -} -ul.navList li{ - list-style:none; - float:left; - padding: 5px 6px; - text-transform:uppercase; -} -ul.subNavList li{ - list-style:none; - float:left; -} -.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { - color:#FFFFFF; - text-decoration:none; - text-transform:uppercase; -} -.topNav a:hover, .bottomNav a:hover { - text-decoration:none; - color:#bb7a2a; - text-transform:uppercase; -} -.navBarCell1Rev { - background-color:#F8981D; - color:#253441; - margin: auto 5px; -} -.skipNav { - position:absolute; - top:auto; - left:-9999px; - overflow:hidden; -} -/* -Page header and footer styles -*/ -.header, .footer { - clear:both; - margin:0 20px; - padding:5px 0 0 0; -} -.indexHeader { - margin:10px; - position:relative; -} -.indexHeader span{ - margin-right:15px; -} -.indexHeader h1 { - font-size:13px; -} -.title { - color:#2c4557; - margin:10px 0; -} -.subTitle { - margin:5px 0 0 0; -} -.header ul { - margin:0 0 15px 0; - padding:0; -} -.footer ul { - margin:20px 0 5px 0; -} -.header ul li, .footer ul li { - list-style:none; - font-size:13px; -} -/* -Heading styles -*/ -div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { - background-color:#dee3e9; - border:1px solid #d0d9e0; - margin:0 0 6px -8px; - padding:7px 5px; -} -ul.blockList ul.blockList ul.blockList li.blockList h3 { - background-color:#dee3e9; - border:1px solid #d0d9e0; - margin:0 0 6px -8px; - padding:7px 5px; -} -ul.blockList ul.blockList li.blockList h3 { - padding:0; - margin:15px 0; -} -ul.blockList li.blockList h2 { - padding:0px 0 20px 0; -} -/* -Page layout container styles -*/ -.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { - clear:both; - padding:10px 20px; - position:relative; -} -.indexContainer { - margin:10px; - position:relative; - font-size:12px; -} -.indexContainer h2 { - font-size:13px; - padding:0 0 3px 0; -} -.indexContainer ul { - margin:0; - padding:0; -} -.indexContainer ul li { - list-style:none; - padding-top:2px; -} -.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { - font-size:12px; - font-weight:bold; - margin:10px 0 0 0; - color:#4E4E4E; -} -.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { - margin:5px 0 10px 0px; - font-size:14px; - font-family:'DejaVu Sans Mono',monospace; -} -.serializedFormContainer dl.nameValue dt { - margin-left:1px; - font-size:1.1em; - display:inline; - font-weight:bold; -} -.serializedFormContainer dl.nameValue dd { - margin:0 0 0 1px; - font-size:1.1em; - display:inline; -} -/* -List styles -*/ -ul.horizontal li { - display:inline; - font-size:0.9em; -} -ul.inheritance { - margin:0; - padding:0; -} -ul.inheritance li { - display:inline; - list-style:none; -} -ul.inheritance li ul.inheritance { - margin-left:15px; - padding-left:15px; - padding-top:1px; -} -ul.blockList, ul.blockListLast { - margin:10px 0 10px 0; - padding:0; -} -ul.blockList li.blockList, ul.blockListLast li.blockList { - list-style:none; - margin-bottom:15px; - line-height:1.4; -} -ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { - padding:0px 20px 5px 10px; - border:1px solid #ededed; - background-color:#f8f8f8; -} -ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { - padding:0 0 5px 8px; - background-color:#ffffff; - border:none; -} -ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { - margin-left:0; - padding-left:0; - padding-bottom:15px; - border:none; -} -ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { - list-style:none; - border-bottom:none; - padding-bottom:0; -} -table tr td dl, table tr td dl dt, table tr td dl dd { - margin-top:0; - margin-bottom:1px; -} -/* -Table styles -*/ -.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { - width:100%; - border-left:1px solid #EEE; - border-right:1px solid #EEE; - border-bottom:1px solid #EEE; -} -.overviewSummary, .memberSummary { - padding:0px; -} -.overviewSummary caption, .memberSummary caption, .typeSummary caption, -.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { - position:relative; - text-align:left; - background-repeat:no-repeat; - color:#253441; - font-weight:bold; - clear:none; - overflow:hidden; - padding:0px; - padding-top:10px; - padding-left:1px; - margin:0px; - white-space:pre; -} -.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, -.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, -.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, -.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, -.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, -.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, -.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, -.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { - color:#FFFFFF; -} -.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, -.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - padding-bottom:7px; - display:inline-block; - float:left; - background-color:#F8981D; - border: none; - height:16px; -} -.memberSummary caption span.activeTableTab span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - margin-right:3px; - display:inline-block; - float:left; - background-color:#F8981D; - height:16px; -} -.memberSummary caption span.tableTab span { - white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - margin-right:3px; - display:inline-block; - float:left; - background-color:#4D7A97; - height:16px; -} -.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { - padding-top:0px; - padding-left:0px; - padding-right:0px; - background-image:none; - float:none; - display:inline; -} -.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, -.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { - display:none; - width:5px; - position:relative; - float:left; - background-color:#F8981D; -} -.memberSummary .activeTableTab .tabEnd { - display:none; - width:5px; - margin-right:3px; - position:relative; - float:left; - background-color:#F8981D; -} -.memberSummary .tableTab .tabEnd { - display:none; - width:5px; - margin-right:3px; - position:relative; - background-color:#4D7A97; - float:left; - -} -.overviewSummary td, .memberSummary td, .typeSummary td, -.useSummary td, .constantsSummary td, .deprecatedSummary td { - text-align:left; - padding:0px 0px 12px 10px; - width:100%; -} -th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, -td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ - vertical-align:top; - padding-right:0px; - padding-top:8px; - padding-bottom:3px; -} -th.colFirst, th.colLast, th.colOne, .constantsSummary th { - background:#dee3e9; - text-align:left; - padding:8px 3px 3px 7px; -} -td.colFirst, th.colFirst { - white-space:nowrap; - font-size:13px; -} -td.colLast, th.colLast { - font-size:13px; -} -td.colOne, th.colOne { - font-size:13px; -} -.overviewSummary td.colFirst, .overviewSummary th.colFirst, -.overviewSummary td.colOne, .overviewSummary th.colOne, -.memberSummary td.colFirst, .memberSummary th.colFirst, -.memberSummary td.colOne, .memberSummary th.colOne, -.typeSummary td.colFirst{ - width:25%; - vertical-align:top; -} -td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { - font-weight:bold; -} -.tableSubHeadingColor { - background-color:#EEEEFF; -} -.altColor { - background-color:#FFFFFF; -} -.rowColor { - background-color:#EEEEEF; -} -/* -Content styles -*/ -.description pre { - margin-top:0; -} -.deprecatedContent { - margin:0; - padding:10px 0; -} -.docSummary { - padding:0; -} - -ul.blockList ul.blockList ul.blockList li.blockList h3 { - font-style:normal; -} - -div.block { - font-size:14px; - font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; -} - -td.colLast div { - padding-top:0px; -} - - -td.colLast a { - padding-bottom:3px; -} -/* -Formatting effect styles -*/ -.sourceLineNo { - color:green; - padding:0 30px 0 0; -} -h1.hidden { - visibility:hidden; - overflow:hidden; - font-size:10px; -} -.block { - display:block; - margin:3px 10px 2px 0px; - color:#474747; -} -.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, -.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, -.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { - font-weight:bold; -} -.deprecationComment, .emphasizedPhrase, .interfaceName { - font-style:italic; -} - -div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, -div.block div.block span.interfaceName { - font-style:normal; -} - -div.contentContainer ul.blockList li.blockList h2{ - padding-bottom:0px; -} - - - -/* -Spring -*/ - -pre.code { - background-color: #F8F8F8; - border: 1px solid #CCCCCC; - border-radius: 3px 3px 3px 3px; - overflow: auto; - padding: 10px; - margin: 4px 20px 2px 0px; -} - -pre.code code, pre.code code * { - font-size: 1em; -} - -pre.code code, pre.code code * { - padding: 0 !important; - margin: 0 !important; -} - diff --git a/spring-cloud-stream-core-docs/src/main/xslt/dependencyVersions.xsl b/spring-cloud-stream-core-docs/src/main/xslt/dependencyVersions.xsl deleted file mode 100644 index 1dabd2ea3..000000000 --- a/spring-cloud-stream-core-docs/src/main/xslt/dependencyVersions.xsl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - |=== - | Group ID | Artifact ID | Version - - - - - | ` - - ` - | ` - - ` - | - - - - |=== - - -