Files
spring-cloud-stream-samples/kafka-batch-sample
Steven PG 547ca663c5 Add Spring Batch Producer example to existing Kafka batch sample (#240)
* Add working batch-produce example in same style as existing sample app

* add documentation and alignment with existing project

* capitalization
2023-02-09 17:58:41 -05:00
..
2020-09-10 16:18:43 -04:00
2020-09-10 16:18:43 -04:00
2020-09-10 16:18:43 -04:00
2020-09-10 16:18:43 -04:00

== What is this app?

This is an example of a Spring Cloud Stream demonstrating the processing of record batches.

The application simply upper-cases the input records and sends them to another topic using two different
implementations. The `batch-produce` profile enables batch publishing.

=== Running the app:

Go to the root of the repository and do:

`docker-compose up -d` (if you don't already have a Kafka broker running locally).

`./mvnw clean package`

`java -jar target/kafka-batch-sample-0.0.1-SNAPSHOT.jar `

There is a simple `@KafkaListener` method to display the records sent to the output topic.

When run with `java -jar target/kafka-batch-sample-0.0.1-SNAPSHOT.jar --spring.profiles.active=transactional` the listener will suspend with

`Hit Enter to exit the listener and commit transaction`.

Pressing the enter key allows the listener to exit and the transaction will commit.

Only then will you see the output from the `@KafkaListener` because its consumer is configured with `isolation.level: read_committed`.