Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

You are going to arrange anumber of services in a way to emulate a small business that has three departments

  • Sales

  • Accounts

  • Resources

The Sales department generates a message on the resources topic, it is a record of a sale, so that the resurcing team can keep stock of what has been sold.

The resources department will display the number of times a product has been sold.

The accounts department needs to know what sales have occurred so that correct ledgering can take place. They receive messages of the accounts topic.

Navigate into C:\work

Clone the project https://bitbucket.org/stream2stream/retail_admin_service-kafka/src/main/
Build the project using mvn package

The application has the following modes of running

# -t <topic name>
# -k <key id>
# -v <payload data as a string>
# -c <behave as a consumer>, -c -p will cause -c to assume the role
# -p <behave as a producer>, -p -c will cause -p to assume the role
# -f <forward topic> forward messages from <watched topic> specied with -t <watched topic> to <forward topic>, if <forward topic> does not exist, it will be created

You will need to consumers, one listening on the resources topic, and the listening on the accounts topic.

The generate a sale we will the swagger UI to a web application

Navigate into C:\work

Clone the application https://bitbucket.org/stream2stream/retail_service-kafka/src/main/

Build it using mvn package

Run the application using java -jar .\target\retail_service.jar

Once the application has started and finished initialising

image-20240709-131957.png

In your browser navigate to http://localhost:8080/swagger-ui/index.html

image-20240709-132123.png

The swagger UI will allow you to create the required data for the ReSTful enpoint in the retail_service_kafka app.

Expand the retail-service-controller tab and select the Try it out button

image-20240709-132348.png

When you select Try it out, you will see

image-20240709-132745.png

As shown in the diagram above you edit the data and then press the Execute button

  • No labels