Files
spring-cloud-stream-samples/non-self-contained-aggregate-app

Spring Cloud Stream - Non self-contained Aggregate application sample
=====================================================================

In this *Spring Cloud Stream* sample, the application shows how to write a non self-contained aggregate application.
A non self-contained application is the one that has its applications directly bound but either or both the input and output of the application is bound to the external broker.

## Requirements

To run this sample, you will need to have installed:

* Java 8 or Above

## Code Tour

* NonSelfContainedAggregateApplication - the Spring Boot Main Aggregate Application that directly binds `Source` and `Processor` application while the processor application's output is bound to Kafka.
* SourceAppConfiguration - Configuration for the source
* ProcessorAppConfiguraion - Configuration for the processor
* SourceApplication - Spring Boot app for the source
* ProcessorApplication - Spring Boot app for the processor

## Running the application

* Go to the application root

* Ensure that you have Kafka running

* Run the Kafka console consume as below:

`bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic processor-output`

`processor-output` is the destination that is bound from the processor.

* `./mvnw clean package`

* `java -jar target/non-self-contained-aggregate-app-0.0.1-SNAPSHOT.jar`

Source application sends a message every second which will initiate the processor which will produce the output into a destination on the broker (Kafka topic in this case).
You will see output similar to the following printed on the kafka console consumer.

```
2018-03-02 19:46:07
2018-03-02 19:46:08
2018-03-02 19:46:09
2018-03-02 19:46:10
2018-03-02 19:46:11
2018-03-02 19:46:12
2018-03-02 19:46:13
2018-03-02 19:46:14
```