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. Copy the file inventory-requests.http from the original git repository to the service folder

    copy c:\vFunctionLab\oms-tutorial\oms-services\inventory-requests.http c:\vFunctionLab\oms-services\inventory-controller 
  8. In VSCode, open the file inventory-requests.http and test the APIs by clicking Send Request above the various REST APIs calls

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

vFunction Logo