CSharpTestBedAdapter 1.3.1122
See the version list below for details.
dotnet add package CSharpTestBedAdapter --version 1.3.1122
NuGet\Install-Package CSharpTestBedAdapter -Version 1.3.1122
<PackageReference Include="CSharpTestBedAdapter" Version="1.3.1122" />
paket add CSharpTestBedAdapter --version 1.3.1122
#r "nuget: CSharpTestBedAdapter, 1.3.1122"
// Install CSharpTestBedAdapter as a Cake Addin #addin nuget:?package=CSharpTestBedAdapter&version=1.3.1122 // Install CSharpTestBedAdapter as a Cake Tool #tool nuget:?package=CSharpTestBedAdapter&version=1.3.1122
csharp-test-bed-adapter
This is the C# Apache Kafka adapter created for the DRIVER-EU test-bed. This allows C# written programs to communicate over the test-bed.
PLEASE NOTICE: The latest version might not be this master. Newer versions are available as release branches (but might be unstable). For implementation of trial 1, please use the branch release/trial_1. For implementation of trial 2, please use the branch release/trial_2.
The implementation is a wrapper around Confluent's .NET Client for Apache Kafka<sup>TM</sup> with the additional NuGet package to support Avro serialization (Confluent.Kafka.Avro (version 0.11.4)), and offers support for:
- Sending and receiving Avro schema's and messages: both producer and consumer use Avro schema's for their message key and value.
Methods for sending and receiving standard or custom messages are
SendMessage
&AddCallback
- Logging via Kafka: your application can log on several log levels (eg. error, debug, info) onto a specific test-bed topic.
Methods for sending and receiving log messages are
Log
&AddLogCallback
- Receive time information (like fictive time, or the speed of the trial) from the time service in the test-bed.
Method for retrieving the time information is
GetTimeInfo
- Internal Management: the adapter makes the coupling between application and test-bed as easy as possible.
Project structure
This project contains one CSharpTestBedAdapter.sln
solution, which in its turn contains 7 C# projects:
src\CSharpTestBedAdapter
The main C# project outputting a class library CSharpTestBedAdapter.dll
that you can use to create Kafka producers and consumers connecting to the DRIVER-EU test-bed.
examples\CSharpExampleProducer (Custom & Standard)
The simple examples for setting up and using a producer via the CSharpTestBedAdapter.dll
.
CSharpExampleProducerCustom
sends out a test message that is defined in example\common\CommonMessages
.
CSharpExampleProducerStandard
sends out a Common Alerting Protocol (CAP) message that is defined in example\common\StandardMessages
.
examples\CSharpExampleConsumer
The simple example for setting up and using a consumer via the CSharpTestBedAdapter.dll
.
This example listens to both the test messages from CSharpExampleProducerCustom
and CAP messages from CSharpExampleProducerStandard
.
src\CommonMessages
A simple project that is used in all examples, containing a simple test Avro schema that is used for transmitting messages of that type from producer to consumer.
Inside the examples\common\CommonMessages\data
folder you'll find a README regarding the conversion from Avro schema to C# class file(s).
src\StandardMessages
The code project that bundles all standard message formats defined for the Common Information Space (CIS) of the DRIVER-EU Test-bed. All these Avro schemas can be found at DRIVER-EU avro-schemas. This project is required for CSharpTestBedAdapter
to run. The following message formats are currently implemented:
- Common Alerting Protocol (CAP)
- Emergency Management Shared Information (EMSI)
- GeoJSON
- Mobile Location Protocol (MLP)
src\CoreMessages
The code project that bundles all system/core message formats defined for the DRIVER-EU Test-bed. These schemas can also be found at DRIVER-EU avro-schemas. This project is required for CSharpTestBedAdapter
to run. The following message formats are currently implemented:
- Heartbeat: sending to topic
system_heartbeat
This allows the adapter to indicate it is still alive for all other adapters in the test-bed. - Log: sending to topic
system_loggin
Both the adapter as your application can send log messages to the test-bed to inform operators on what is going on inside the application. - Admin heartbeat: receiving from topic
system_admin_heartbeat
The adapter checks if the admin tool inside the test-bed is alive. If not during the first 10 seconds of this adapters existence, the adapter will enterDEBUG
mode. If the admin tool was present but connection is lost somehow, the adapter will enterDISABLED
mode until the admin tool comes back alive, re-sending and re-receiving all messages that were queued during being disabled. - Timing: receiving from topic
system_timing
The time service updates all adapters for setting a global time frame. - Time control: receiving from topic
system_timing_control
The time service also notifies all adapters on time changes, for instance whenever a running trial is paused. This only affects the adapter whenever the test-bed admin tool is present. InDEBUG
mode, the adapter will not adhere to stop sending/receiving messages whenever the time service sends aPAUSE
orSTOP
command via this topic.
Dependencies
- All projects are build on the .NET Framework 4.6
- All projects are dependent on one NuGet package from Confluent:
- pre-released Confluent.Kafka.Avro 0.11.4
In order to use the csharp-test-bed-adapter
, you are also required to download and install the above-mentioned NuGet package.
Usage
Build CSharpTestBedAdapter
and reference the compiled DLLs CSharpTestBedAdapter.dll
, CoreMessages.dll
& StandardMessages.dll
into your own application.
Next to the compiled CSharpTestBedAdapter.dll
, there is a CSharpTestBedAdapter-settings.xml
, where you can change the following adapter settings:
- The name of the application that uses this adapter
- The heartbeat interval
- Location of the authorisation certificate (not implemented yet)
- The URL of the Kafka broker
- The URL of the schema registry
- (A)synchronized sending of messages (not implemented yet)
- Number of retries, before reporting an error (not implemented yet)
- The retry interval in between retries (not implemented yet)
See the 3 example projects for further implementation of this adapter.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- Confluent.Kafka.Avro (>= 0.11.4)
- Newtonsoft.Json (>= 11.0.2)
- System.Diagnostics.DiagnosticSource (>= 4.4.1)
- System.Net.Http (>= 4.3.3)
- System.Runtime.CompilerServices.Unsafe (>= 4.4.0)
- System.Security.Cryptography.Algorithms (>= 4.3.1)
- System.Security.Cryptography.X509Certificates (>= 4.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.1.2020.323 | 3,248 | 3/23/2020 |
2.0.2020.310 | 666 | 3/9/2020 |
1.8.2020.121 | 627 | 1/21/2020 |
1.7.2020.115 | 645 | 1/15/2020 |
1.6.2019.1224 | 610 | 12/23/2019 |
1.6.2019.1223 | 581 | 12/23/2019 |
1.5.2019.1029 | 569 | 10/29/2019 |
1.4.2019.603 | 770 | 6/3/2019 |
1.4.2019.204 | 747 | 2/4/2019 |
1.3.1217 | 928 | 12/17/2018 |
1.3.1122 | 832 | 12/10/2018 |
First release of the C# test-bed adapter