The producer is a console app. It simulates a sensor attached to a taxi driving in a city. It loads data from files that record the locations of taxi and emits to Azure Storage Account Table.
The producer and the consumer are implemented in C#. They are running on the cross-platform .NET Core 2.0.
- You need Visual Studio 2017 version 15.3.0 or higher with the .NET Core cross-platform development workload. Please follow this official guide to install this workload.
- An existing Storage Account. Follow this link to create a Storage Account in the Azure Portal.
- Launch Visual Studio 2017 and open project file
producer.csproj
in theclient/producer
folder. - Check
appsettings.json
file to make sure the properties connectionString and eventHubName are configured correctly. - You can press F5 to start the app in debug mode. Visual Studio 2017 will then start restoring the dependency packages, after which the debugger will start.
Note: Make sure your project path does not contain any special characters (such as %20) otherwise restoring of NuGet packages may fail with an error message similar to this:
The operation failed as details for project producer could not be loaded.
- Press Shift + F5 to exit debug mode.
- Install .NET Core on your environment (Windows, Linux or macOS/OS X)
- Switch to producer folder
cd clients\producer
- Restore
dotnet restore
- Build
dotnet build
- Publish
For Windows 10
dotnet publish -c Release -r win10-x64
For Linux
dotnet publish -c Release -r linux-x64
For macOS
dotnet publish -c Release -r osx-x64
The default output location is client\producer\bin\Release\netcoreapp2.0
Now, you have an executable in your output folder that will allow you to run the producer without the use of Visual Studio.