Files
spring-cloud-stream-samples/multi-functions-samples/function-composition-kafka
Soby Chacko 24997117d4 Spring Boot and Cloud updates
Update samples to use Boot 2.4.4
Spring Cloud is updated to 2020.0.2

Remove empty integration tests
2021-03-24 22:47:17 -04:00
..
2021-03-24 22:47:17 -04:00
2021-03-24 22:47:17 -04:00
2019-11-12 17:12:03 -05:00

==== Spring Cloud Stream Function Composition Sample

In this *Spring Cloud Stream* sample, we will demo function composition with Kafka.

## Requirements

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

* Java 8 or Above

## Running the application

The following instructions assume that you are running Kafka as a Docker image.

* Go to the application root
* `docker-compose up -d`

* `./mvnw clean package`

* `java -jar target/function-composition-kafka-0.0.1-SNAPSHOT.jar`

Take a look at the configuration in the application.yml file. The function definition is `uppercase|echo` and the incoming destination is defined as `uppercase-in` (through `uppercase|echo-in-0.destination`)

Now, send some text data to the input topic,

`docker exec -it kafka /opt/kafka/bin/kafka-console-producer.sh --broker-list 127.0.0.1:9092 --topic uppercase-in`

and then watch the application console.

You should see output messages from both `uppercase` and `echo` functions.

* `docker-compose down`