To run order-service locally you need:
- run Docker daemon on local machine
To start order-service locally, you need to run the app from IJ with spring profile local. Both Run/Debug mode are
supported.
Using this profile the application:
- run automatically kafka in docker container during the app run using testcontainers
- run automatically kafka UI in docker container during the app run using testcontainers
Once the app is exited, the containers will be stopped and removed automatically. There is no manual step needed.
To access Kafka UI, open the browser and navigate to http://localhost:8088.
To publish a test message to Kafka topic via Kafka UI, follow these steps:
-
Open Kafka UI in your browser at
http://localhost:8088. -
Select the Kafka cluster you want to interact with.
-
Select
Topicsfrom the navigation panel on the left. -
Select the given topic you want to publish a message to.
-
Click on the
Produce Messagebutton. -
In the
Keyfield, enter the key identifier for your message -
In the
Valuefield, enter the message content in JSON format. Example" -
In payload section add
{
"orderId": "550e8400-e29b-41d4-a716-446655440001",
"clientId": "123e4567-e89b-12d3-a456-426614174001",
"orderTotal": 284.97,
"requestedAt": "2024-01-15T10:30:00"
}- In the
Headerssection you can add correlationId for tracing
{
"X-Correlation-Id": "550e8400-e29b-41d4-a716-446655440001"
}