github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/inputs/aws_kinesis.md (about) 1 --- 2 title: aws_kinesis 3 type: input 4 status: stable 5 categories: ["Services","AWS"] 6 --- 7 8 <!-- 9 THIS FILE IS AUTOGENERATED! 10 11 To make changes please edit the contents of: 12 lib/input/aws_kinesis.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 19 Receive messages from one or more Kinesis streams. 20 21 Introduced in version 3.36.0. 22 23 24 <Tabs defaultValue="common" values={[ 25 { label: 'Common', value: 'common', }, 26 { label: 'Advanced', value: 'advanced', }, 27 ]}> 28 29 <TabItem value="common"> 30 31 ```yaml 32 # Common config fields, showing default values 33 input: 34 label: "" 35 aws_kinesis: 36 streams: [] 37 dynamodb: 38 table: "" 39 create: false 40 checkpoint_limit: 1 41 commit_period: 5s 42 start_from_oldest: true 43 region: eu-west-1 44 batching: 45 count: 0 46 byte_size: 0 47 period: "" 48 check: "" 49 ``` 50 51 </TabItem> 52 <TabItem value="advanced"> 53 54 ```yaml 55 # All config fields, showing default values 56 input: 57 label: "" 58 aws_kinesis: 59 streams: [] 60 dynamodb: 61 table: "" 62 create: false 63 billing_mode: PAY_PER_REQUEST 64 read_capacity_units: 0 65 write_capacity_units: 0 66 checkpoint_limit: 1 67 commit_period: 5s 68 rebalance_period: 30s 69 lease_period: 30s 70 start_from_oldest: true 71 region: eu-west-1 72 endpoint: "" 73 credentials: 74 profile: "" 75 id: "" 76 secret: "" 77 token: "" 78 role: "" 79 role_external_id: "" 80 batching: 81 count: 0 82 byte_size: 0 83 period: "" 84 check: "" 85 processors: [] 86 ``` 87 88 </TabItem> 89 </Tabs> 90 91 Consumes messages from one or more Kinesis streams either by automatically balancing shards across other instances of this input, or by consuming shards listed explicitly. The latest message sequence consumed by this input is stored within a [DynamoDB table](#table-schema), which allows it to resume at the correct sequence of the shard during restarts. This table is also used for coordination across distributed inputs when shard balancing. 92 93 Benthos will not store a consumed sequence unless it is acknowledged at the output level, which ensures at-least-once delivery guarantees. However, this also means that by default messages of a given shard cannot be processed concurrently. In order to increase the number of shard messages that can be processed concurrently increase the field `checkpoint_limit`. 94 95 ## Table Schema 96 97 It's possible to configure Benthos to create the DynamoDB table required for coordination if it does not already exist. However, if you wish to create this yourself (recommended) then create a table with a string HASH key `StreamID` and a string RANGE key `ShardID`. 98 99 ## Batching 100 101 Use the `batching` fields to configure an optional [batching policy](/docs/configuration/batching#batch-policy). Each stream shard will be batched separately in order to ensure that acknowledgements aren't contaminated. Any other batching mechanism will stall with this input due its sequential transaction model. 102 103 ## Fields 104 105 ### `streams` 106 107 One or more Kinesis data streams to consume from. Shards of a stream are automatically balanced across consumers by coordinating through the provided DynamoDB table. Multiple comma separated streams can be listed in a single element. Shards are automatically distributed across consumers of a stream by coordinating through the provided DynamoDB table. Alternatively, it's possible to specify an explicit shard to consume from with a colon after the stream name, e.g. `foo:0` would consume the shard `0` of the stream `foo`. 108 109 110 Type: `array` 111 Default: `[]` 112 113 ### `dynamodb` 114 115 Determines the table used for storing and accessing the latest consumed sequence for shards, and for coordinating balanced consumers of streams. 116 117 118 Type: `object` 119 120 ### `dynamodb.table` 121 122 The name of the table to access. 123 124 125 Type: `string` 126 Default: `""` 127 128 ### `dynamodb.create` 129 130 Whether, if the table does not exist, it should be created. 131 132 133 Type: `bool` 134 Default: `false` 135 136 ### `dynamodb.billing_mode` 137 138 When creating the table determines the billing mode. 139 140 141 Type: `string` 142 Default: `"PAY_PER_REQUEST"` 143 Options: `PROVISIONED`, `PAY_PER_REQUEST`. 144 145 ### `dynamodb.read_capacity_units` 146 147 Set the provisioned read capacity when creating the table with a `billing_mode` of `PROVISIONED`. 148 149 150 Type: `int` 151 Default: `0` 152 153 ### `dynamodb.write_capacity_units` 154 155 Set the provisioned write capacity when creating the table with a `billing_mode` of `PROVISIONED`. 156 157 158 Type: `int` 159 Default: `0` 160 161 ### `checkpoint_limit` 162 163 The maximum gap between the in flight sequence versus the latest acknowledged sequence at a given time. Increasing this limit enables parallel processing and batching at the output level to work on individual shards. Any given sequence will not be committed unless all messages under that offset are delivered in order to preserve at least once delivery guarantees. 164 165 166 Type: `int` 167 Default: `1` 168 169 ### `commit_period` 170 171 The period of time between each update to the checkpoint table. 172 173 174 Type: `string` 175 Default: `"5s"` 176 177 ### `rebalance_period` 178 179 The period of time between each attempt to rebalance shards across clients. 180 181 182 Type: `string` 183 Default: `"30s"` 184 185 ### `lease_period` 186 187 The period of time after which a client that has failed to update a shard checkpoint is assumed to be inactive. 188 189 190 Type: `string` 191 Default: `"30s"` 192 193 ### `start_from_oldest` 194 195 Whether to consume from the oldest message when a sequence does not yet exist for the stream. 196 197 198 Type: `bool` 199 Default: `true` 200 201 ### `region` 202 203 The AWS region to target. 204 205 206 Type: `string` 207 Default: `"eu-west-1"` 208 209 ### `endpoint` 210 211 Allows you to specify a custom endpoint for the AWS API. 212 213 214 Type: `string` 215 Default: `""` 216 217 ### `credentials` 218 219 Optional manual configuration of AWS credentials to use. More information can be found [in this document](/docs/guides/cloud/aws). 220 221 222 Type: `object` 223 224 ### `credentials.profile` 225 226 A profile from `~/.aws/credentials` to use. 227 228 229 Type: `string` 230 Default: `""` 231 232 ### `credentials.id` 233 234 The ID of credentials to use. 235 236 237 Type: `string` 238 Default: `""` 239 240 ### `credentials.secret` 241 242 The secret for the credentials being used. 243 244 245 Type: `string` 246 Default: `""` 247 248 ### `credentials.token` 249 250 The token for the credentials being used, required when using short term credentials. 251 252 253 Type: `string` 254 Default: `""` 255 256 ### `credentials.role` 257 258 A role ARN to assume. 259 260 261 Type: `string` 262 Default: `""` 263 264 ### `credentials.role_external_id` 265 266 An external ID to provide when assuming a role. 267 268 269 Type: `string` 270 Default: `""` 271 272 ### `batching` 273 274 Allows you to configure a [batching policy](/docs/configuration/batching). 275 276 277 Type: `object` 278 279 ```yaml 280 # Examples 281 282 batching: 283 byte_size: 5000 284 count: 0 285 period: 1s 286 287 batching: 288 count: 10 289 period: 1s 290 291 batching: 292 check: this.contains("END BATCH") 293 count: 0 294 period: 1m 295 ``` 296 297 ### `batching.count` 298 299 A number of messages at which the batch should be flushed. If `0` disables count based batching. 300 301 302 Type: `int` 303 Default: `0` 304 305 ### `batching.byte_size` 306 307 An amount of bytes at which the batch should be flushed. If `0` disables size based batching. 308 309 310 Type: `int` 311 Default: `0` 312 313 ### `batching.period` 314 315 A period in which an incomplete batch should be flushed regardless of its size. 316 317 318 Type: `string` 319 Default: `""` 320 321 ```yaml 322 # Examples 323 324 period: 1s 325 326 period: 1m 327 328 period: 500ms 329 ``` 330 331 ### `batching.check` 332 333 A [Bloblang query](/docs/guides/bloblang/about/) that should return a boolean value indicating whether a message should end a batch. 334 335 336 Type: `string` 337 Default: `""` 338 339 ```yaml 340 # Examples 341 342 check: this.type == "end_of_transaction" 343 ``` 344 345 ### `batching.processors` 346 347 A list of [processors](/docs/components/processors/about) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. Please note that all resulting messages are flushed as a single batch, therefore splitting the batch into smaller batches using these processors is a no-op. 348 349 350 Type: `array` 351 Default: `[]` 352 353 ```yaml 354 # Examples 355 356 processors: 357 - archive: 358 format: lines 359 360 processors: 361 - archive: 362 format: json_array 363 364 processors: 365 - merge_json: {} 366 ``` 367 368