Data Typing and Schemas Handling
Overview
Nussknacker as a platform integrates diverse data sources, e.g. kafka topic or http request, and also allows to enrich data using e.g. OpenAPI or databases. These integrations can return several types of data like JSON, Binary, and DB data. In each case format of these data is described in a different way:
- Request-response inputs and outputs are described by JSON Schema, stored in Nussknacker scenario's properties
- Source Kafka with JSON data is described by JSON Schema, stored in the schema registry
- Source Kafka with binary data is described by Avro schema, stored in the schema registry
- OpenAPI enricher uses JSON data described by OpenAPI schema
- Database data are described by JDBC metadata, that contain column information
To provide consistent and proper support for these formats Nussknacker converts meta-information about data to its
own Typing Information
, which is used on the Designer's part to hint and validate the data. Each part of the diagram
is statically validated and typed on an ongoing basis.
Avro schema
We support Avro schema in version: 1.11.0
. Avro is available only
on Streaming. You need
Schema Registry if you want to use Avro Schema.
Source conversion mapping
Primitive types
Avro type | Java type | Comment |
---|---|---|
null | null | |
string | String / Char | Defaults to Java String (UTF-8). Use the advanced configuration option AVRO_USE_STRING_FOR_STRING_TYPE=false to change it to CharSequence |
boolean | Boolean | |
int | Integer | 32 bit |
long | Long | 64 bit |
float | Float | single precision |
double | Double | double precision |
bytes | ByteBuffer |