Inventory Hub App using Java on Azure
The purpose of this sample application is to illustrate building responsive systems with serverless, event-driven Java on Azure; the result of this project will be to create a real-time inventory hub.
In order to create and deploy this sample application, you need to have the following:
An Azure subscription; if you don't already have an Azure subscription, you can activate your MSDN subscriber benefits or sign up for a free Azure account.
In addition, you will need all of the following components before you go through the steps in this README:
| Azure CLI | Java 8 | Maven 3 | Git |
NOTE: There are additional requirements in the ~/deployment/README.md file which are required in order to setup your development environment; other required components will be installed automatically by the provisioning scripts.
In the following sections, you will create a development sandbox environment on Azure which uses the following components:
- Two Event Hubs in one Event Hub Namespace per region
- an event hub receives events from Point of Sale (POS) and Point of Intake (POI) units
- an event hub receives events to notify any app that listens for inventory change
- One Cosmos DB configured for "read/write" in the first region and "read" for additional regions
- Set of Azure Functions apps per region
- One Point of Sale (POS) function app to simulate a terminal in a store, one per terminal
- One Point of Intake (POI) function app to simulate a terminal in a warehouse, one per terminal
- One Update Inventory function app triggered by events produced by POS and POI units to update inventory
- One Notify function app triggered by updates to inventory
- One Azure Web App per region or One Pivotal Cloud Foundry instance on Azure per region
The following diagram illustrates the full topology for this sample application environment:
Create and Deploy the Inventory Hub
Create the initial build
- Open a command prompt and navigate to the ~/deployment/ folder of your local repo.
Login to your Azure account and specify which subscription to use:
az account set --subscription "<your-azure-subscription>"
NOTE: You can use either a subscription name or id when specifying which subscription to use; to obtain a list of your subscriptions, type
az account list.
Set a unique prefix for creating an initial layout on Azure.
Follow the deployment README instructions to create Azure resources.
Deploy Inventory Processor
- Deploy Update Product Inventory function app as described in the README
- Deploy Append Transactions function app as described in the README
Deploy Inventory Dashboard Web App
- Deploy Inventory Dashboard Web app as described in README
Deploy POI and POS Terminals as Azure Function Apps
- Deploy Point of Inventory terminal as function app as described in README. Deploy one per terminal. If you were to imagine 4 terminals then you would deploy 4 similar function apps
- Deploy Point of Sale terminal as function app as described in README. Deploy one per terminal. If you were to imagine 4 terminals then you would deploy 4 similar function apps
Open the Inventory Hub Web App
Open the Inventory Hub Web app ...
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct.
For more information see the Code of Conduct FAQ or
contact [email protected] with any additional questions or comments.