Skip to content

Latest commit

 

History

History
 
 

micronaut-pizza-gen

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Random Pizza Generator

Description

This demo consists of the following Micronaut projects:

  • pizza-generator is a standard Micronaut app with the Kafka feature.

  • sauce-service is Micronaut Messaging app with Kafka.

  • cheese-service is Micronaut Messaging app with Kafka.

  • meat-service is Micronaut Messaging app with Kafka.

  • veggie-service is Micronaut Messaging app with Kafka.

The demo was built using Confluent Cloud, the Cloud-native service for Apache Kafka. If you don’t have an account on Confluent Cloud, you can set that up [here](https://www.confluent.io/confluent-cloud).

Building the demo

Each of the five projects contain the Gradle Wrapper. To build from the root directory of a project run ./gradlew build. To execute the application run ./gradlew run.

Running the demo

Before running this demo, you will need to update the src/main/resources/application.yml file in each project. Replace all the fields marked with {{ }} using values from your Confluent Cloud cluster and schema registry. Also, you will need to create 5 topics in Confluent Cloud. They can each have 1 partion (or more if you so desire): pizza, pizza-with-sauce, pizza-with-cheese, pizza-with-meat, and pizza-with-veggies.

Once all five services are up and running, you can issue the following curl command to send an order for 3 random pizzas. curl -H "Content-Type: application/json" --request POST -d '{"count":5}' http://localhost:8080/order

This will trigger a series of events which will result in a completed pizza order with the requested pizzas, and it will return a UUID of that pizza order.

To see your pizzas in all their hot, delicious glory, run the following curl command using the UUID returned from the first call.

Note: jq is optional, but very helpful. More info at https://stedolan.github.io/jq/

When you are done working with this demo project, you can delete these topics to avoid additional charges.

Feature http-client documentation

Feature kafka documentation