Skip to content

ksqlDB.RestApi.Client workshop

Tomas Fabian edited this page Jul 16, 2022 · 28 revisions

Create a new ksqlDB.RestApi.Client service project

Prerequisites

  • Visual Studio 2022
  • .NET 5.0 or higher
  1. create a new solution and worker service project
mkdir ksqlDB.RestApi.Client.Sensors
cd ksqlDB.RestApi.Client.Sensors

Add a nuget.config file in the root of your project repository:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<packageSources>
		<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
	</packageSources>

	<packageSourceMapping>
		<packageSource key="nuget.org">
			<package pattern="*" />
		</packageSource>
	</packageSourceMapping>
</configuration>

In case that you don't have installed the latest .NET preview version add a global.json file with an overridden sdk version of your joyce:

dotnet --list-sdks

The following example shows the global.json syntax:

{
  "sdk": {
    "version": "5.0.407"
  }
}

Now we are ready to create our solution:

dotnet new sln -n SensorsStreamProcessor
dotnet new worker -n ksqlDB.RestApi.Client.Sensors
dotnet sln add ksqlDB.RestApi.Client.Sensors

Add a reference to the ksqlDB.RestApi.Client NuGet package.

dotnet add ksqlDB.RestApi.Client.Sensors package ksqlDB.RestApi.Client --version 2.1.3

We prepared the basic structure of the solution and therefore we can open it now with Visual Studio:

./SensorsStreamProcessor.sln

TODO: continue

Congratulations! You've just successfully created your stream processor with ksqlDB.RestApi.Client.

Clone this wiki locally