Skip to content

Spring Cloud Stream example with Java functional programming and Kafka

Notifications You must be signed in to change notification settings

jonathanmdr/Spot

Repository files navigation

Spot


This project is an example of how to use the "Spring Cloud Stream" with Java functional programming.

This example uses the message broker Kafka.

Running environment


For the up environment:

# This command runs: Kafka Broker and Kafka UI
docker-compose up -d

# With makefile
make up

For the down environment:

# This command down all environment and remove all unused files, folders and configurations
docker-compose down --remove-orphans --volumes

# With makefile
make down

API


Request example:

The order with a value less than or equal to 500.00 is valid and returns APPROVED.

The order with a value greater than to 500.00 is invalid and returns REJECTED.

curl --location --request POST 'http://localhost:8080/v1/orders' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customer_id": "36a8ea26-4eb0-4b9d-b609-d095175a2f7b",
    "value": 1000.00
}'