vFunction Logo

Inventory Controller

InventoryController is similar to OrderController, but it uses Apache Geode, so we will need to use one of the profiles defined in the original application for that.

  1. Go to the InventoryController project in your IDE, and perform the steps described in section Config Data Source

  2. To set the service port (the default port 8080 has been taken by OrderController), open the application.properties file and add the property server.port=8081

  3. In addition, add the property spring.profiles.active=local so the GemFire will be used locally. You can view the profile in the file spring-config.xml.

  4. Run the OpenRewrite recipes as you did for OrderController service and review the changes (you can use the git in VSCode).

  5. Open the file src/main/java/com/oms/inventorycontroller/InventoryControllerApp.java and add the annotation @EntityScan(basePackages = { "com.oms.entity" }) and @ComponentScan("com.oms") with the required import statements to the application class, as you did for Order Controller

  6. Build and Run InventoryController as you did for Order Controller.

  7. Test the APIs by switching to Thunder Client in VSCode and sending the APIs for Inventory in the OMS Services collection.

  8. Commit the changes to your local git repo (optional).

vFunction Logo