github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/processors/avro.md (about) 1 --- 2 title: avro 3 type: processor 4 status: beta 5 categories: ["Parsing"] 6 --- 7 8 <!-- 9 THIS FILE IS AUTOGENERATED! 10 11 To make changes please edit the contents of: 12 lib/processor/avro.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 :::caution BETA 19 This component is mostly stable but breaking changes could still be made outside of major version releases if a fundamental problem with the component is found. 20 ::: 21 22 Performs Avro based operations on messages based on a schema. 23 24 25 <Tabs defaultValue="common" values={[ 26 { label: 'Common', value: 'common', }, 27 { label: 'Advanced', value: 'advanced', }, 28 ]}> 29 30 <TabItem value="common"> 31 32 ```yaml 33 # Common config fields, showing default values 34 label: "" 35 avro: 36 operator: to_json 37 encoding: textual 38 schema: "" 39 schema_path: "" 40 ``` 41 42 </TabItem> 43 <TabItem value="advanced"> 44 45 ```yaml 46 # All config fields, showing default values 47 label: "" 48 avro: 49 operator: to_json 50 encoding: textual 51 schema: "" 52 schema_path: "" 53 parts: [] 54 ``` 55 56 </TabItem> 57 </Tabs> 58 59 WARNING: If you are consuming or generating messages using a schema registry service then it is likely this processor will fail as those services require messages to be prefixed with the identifier of the schema version being used. Instead, try the [`schema_registry_encode`](/docs/components/processors/schema_registry_encode) and [`schema_registry_decode`](/docs/components/processors/schema_registry_decode) processors. 60 61 ## Operators 62 63 ### `to_json` 64 65 Converts Avro documents into a JSON structure. This makes it easier to 66 manipulate the contents of the document within Benthos. The encoding field 67 specifies how the source documents are encoded. 68 69 ### `from_json` 70 71 Attempts to convert JSON documents into Avro documents according to the 72 specified encoding. 73 74 ## Fields 75 76 ### `operator` 77 78 The [operator](#operators) to execute 79 80 81 Type: `string` 82 Default: `"to_json"` 83 Options: `to_json`, `from_json`. 84 85 ### `encoding` 86 87 An Avro encoding format to use for conversions to and from a schema. 88 89 90 Type: `string` 91 Default: `"textual"` 92 Options: `textual`, `binary`, `single`. 93 94 ### `schema` 95 96 A full Avro schema to use. 97 98 99 Type: `string` 100 Default: `""` 101 102 ### `schema_path` 103 104 The path of a schema document to apply. Use either this or the `schema` field. 105 106 107 Type: `string` 108 Default: `""` 109 110 ```yaml 111 # Examples 112 113 schema_path: file://path/to/spec.avsc 114 115 schema_path: http://localhost:8081/path/to/spec/versions/1 116 ``` 117 118 ### `parts` 119 120 An optional array of message indexes of a batch that the processor should apply to. 121 If left empty all messages are processed. This field is only applicable when 122 batching messages [at the input level](/docs/configuration/batching). 123 124 Indexes can be negative, and if so the part will be selected from the end 125 counting backwards starting from -1. 126 127 128 Type: `array` 129 Default: `[]` 130 131