avro deserialize action Avro Deserialize Action

Provided by: "Apache Software Foundation"

Support Level for this Kamelet is: "Preview"

Deserialize payload to Avro

Configuration Options

The following table summarizes the configuration options available for the avro-deserialize-action Kamelet:

Property Name Description Type Default Example

schema *

Schema

The Avro schema to use during serialization (as single-line, using JSON format)

string

"{\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}"

validate

Validate

Indicates if the content must be validated against the schema

boolean

true

Fields marked with (*) are mandatory.

Usage

This section summarizes how the avro-deserialize-action can be used in various contexts.

Knative Action

The avro-deserialize-action Kamelet can be used as intermediate step in a binding.

avro-deserialize-action-binding.yaml
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: avro-deserialize-action-binding
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: timer-source
    properties:
      message: "Hello"
  steps:
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: avro-deserialize-action
    properties:
      schema: "{\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}"
  sink:
    ref:
      kind: InMemoryChannel
      apiVersion: messaging.knative.dev/v1
      name: mychannel

Make sure you have Camel K installed into the Kubernetes cluster you’re connected to.

Save the avro-deserialize-action-binding.yaml file into your hard drive, then configure it according to your needs.

You can run the action using the following command:

kubectl apply -f avro-deserialize-action-binding.yaml