
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.
Go to the InventoryController project in your IDE, and perform the steps described in section Config Data Source
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
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.
In AmazonQ or CoPilot run the following prompt in a new chat:
@Workspace migrate inventory-controller to Java 17 and to the latest SpringBoot 3
Make sure to run commands prompted by the agent.
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
Build and Run InventoryController as you did for Order Controller.
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 In VS Code, open the file inventory-requests.http and test the APIs by clicking Send Request above the various REST APIs calls
Commit the changes to your local git repo (optional).
