github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/inputs/amqp_0_9.md (about) 1 --- 2 title: amqp_0_9 3 type: input 4 status: stable 5 categories: ["Services"] 6 --- 7 8 <!-- 9 THIS FILE IS AUTOGENERATED! 10 11 To make changes please edit the contents of: 12 lib/input/amqp_0_9.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 19 Connects to an AMQP (0.91) queue. AMQP is a messaging protocol used by various 20 message brokers, including RabbitMQ. 21 22 23 <Tabs defaultValue="common" values={[ 24 { label: 'Common', value: 'common', }, 25 { label: 'Advanced', value: 'advanced', }, 26 ]}> 27 28 <TabItem value="common"> 29 30 ```yaml 31 # Common config fields, showing default values 32 input: 33 label: "" 34 amqp_0_9: 35 urls: [] 36 queue: benthos-queue 37 consumer_tag: benthos-consumer 38 prefetch_count: 10 39 ``` 40 41 </TabItem> 42 <TabItem value="advanced"> 43 44 ```yaml 45 # All config fields, showing default values 46 input: 47 label: "" 48 amqp_0_9: 49 urls: [] 50 queue: benthos-queue 51 queue_declare: 52 enabled: false 53 durable: true 54 bindings_declare: [] 55 consumer_tag: benthos-consumer 56 auto_ack: false 57 nack_reject_patterns: [] 58 prefetch_count: 10 59 prefetch_size: 0 60 tls: 61 enabled: false 62 skip_cert_verify: false 63 enable_renegotiation: false 64 root_cas: "" 65 root_cas_file: "" 66 client_certs: [] 67 ``` 68 69 </TabItem> 70 </Tabs> 71 72 TLS is automatic when connecting to an `amqps` URL, but custom 73 settings can be enabled in the `tls` section. 74 75 ### Metadata 76 77 This input adds the following metadata fields to each message: 78 79 ``` text 80 - amqp_content_type 81 - amqp_content_encoding 82 - amqp_delivery_mode 83 - amqp_priority 84 - amqp_correlation_id 85 - amqp_reply_to 86 - amqp_expiration 87 - amqp_message_id 88 - amqp_timestamp 89 - amqp_type 90 - amqp_user_id 91 - amqp_app_id 92 - amqp_consumer_tag 93 - amqp_delivery_tag 94 - amqp_redelivered 95 - amqp_exchange 96 - amqp_routing_key 97 - All existing message headers, including nested headers prefixed with the key of their respective parent. 98 ``` 99 100 You can access these metadata fields using 101 [function interpolation](/docs/configuration/interpolation#metadata). 102 103 ## Fields 104 105 ### `urls` 106 107 A list of URLs to connect to. The first URL to successfully establish a connection will be used until the connection is closed. If an item of the list contains commas it will be expanded into multiple URLs. 108 109 110 Type: `array` 111 Default: `[]` 112 Requires version 3.58.0 or newer 113 114 ```yaml 115 # Examples 116 117 urls: 118 - amqp://guest:guest@127.0.0.1:5672/ 119 120 urls: 121 - amqp://127.0.0.1:5672/,amqp://127.0.0.2:5672/ 122 123 urls: 124 - amqp://127.0.0.1:5672/ 125 - amqp://127.0.0.2:5672/ 126 ``` 127 128 ### `queue` 129 130 An AMQP queue to consume from. 131 132 133 Type: `string` 134 Default: `"benthos-queue"` 135 136 ### `queue_declare` 137 138 Allows you to passively declare the target queue. If the queue already exists 139 then the declaration passively verifies that they match the target fields. 140 141 142 Type: `object` 143 144 ### `queue_declare.enabled` 145 146 Whether to enable queue declaration. 147 148 149 Type: `bool` 150 Default: `false` 151 152 ### `queue_declare.durable` 153 154 Whether the declared queue is durable. 155 156 157 Type: `bool` 158 Default: `false` 159 160 ### `bindings_declare` 161 162 Allows you to passively declare bindings for the target queue. 163 164 165 Type: `array` 166 Default: `[]` 167 168 ```yaml 169 # Examples 170 171 bindings_declare: 172 - exchange: foo 173 key: bar 174 ``` 175 176 ### `bindings_declare[].exchange` 177 178 The exchange of the declared binding. 179 180 181 Type: `string` 182 Default: `""` 183 184 ### `bindings_declare[].key` 185 186 The key of the declared binding. 187 188 189 Type: `string` 190 Default: `""` 191 192 ### `consumer_tag` 193 194 A consumer tag. 195 196 197 Type: `string` 198 Default: `"benthos-consumer"` 199 200 ### `auto_ack` 201 202 Acknowledge messages automatically as they are consumed rather than waiting for acknowledgments from downstream. This can improve throughput and prevent the pipeline from blocking but at the cost of eliminating delivery guarantees. 203 204 205 Type: `bool` 206 Default: `false` 207 208 ### `nack_reject_patterns` 209 210 A list of regular expression patterns whereby if a message that has failed to be delivered by Benthos has an error that matches it will be dropped (or delivered to a dead-letter queue if one exists). By default failed messages are nacked with requeue enabled. 211 212 213 Type: `array` 214 Default: `[]` 215 Requires version 3.64.0 or newer 216 217 ```yaml 218 # Examples 219 220 nack_reject_patterns: 221 - ^reject me please:.+$ 222 ``` 223 224 ### `prefetch_count` 225 226 The maximum number of pending messages to have consumed at a time. 227 228 229 Type: `int` 230 Default: `10` 231 232 ### `prefetch_size` 233 234 The maximum amount of pending messages measured in bytes to have consumed at a time. 235 236 237 Type: `int` 238 Default: `0` 239 240 ### `tls` 241 242 Custom TLS settings can be used to override system defaults. 243 244 245 Type: `object` 246 247 ### `tls.enabled` 248 249 Whether custom TLS settings are enabled. 250 251 252 Type: `bool` 253 Default: `false` 254 255 ### `tls.skip_cert_verify` 256 257 Whether to skip server side certificate verification. 258 259 260 Type: `bool` 261 Default: `false` 262 263 ### `tls.enable_renegotiation` 264 265 Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you're seeing the error message `local error: tls: no renegotiation`. 266 267 268 Type: `bool` 269 Default: `false` 270 Requires version 3.45.0 or newer 271 272 ### `tls.root_cas` 273 274 An optional root certificate authority to use. This is a string, representing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate. 275 276 277 Type: `string` 278 Default: `""` 279 280 ```yaml 281 # Examples 282 283 root_cas: |- 284 -----BEGIN CERTIFICATE----- 285 ... 286 -----END CERTIFICATE----- 287 ``` 288 289 ### `tls.root_cas_file` 290 291 An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate. 292 293 294 Type: `string` 295 Default: `""` 296 297 ```yaml 298 # Examples 299 300 root_cas_file: ./root_cas.pem 301 ``` 302 303 ### `tls.client_certs` 304 305 A list of client certificates to use. For each certificate either the fields `cert` and `key`, or `cert_file` and `key_file` should be specified, but not both. 306 307 308 Type: `array` 309 Default: `[]` 310 311 ```yaml 312 # Examples 313 314 client_certs: 315 - cert: foo 316 key: bar 317 318 client_certs: 319 - cert_file: ./example.pem 320 key_file: ./example.key 321 ``` 322 323 ### `tls.client_certs[].cert` 324 325 A plain text certificate to use. 326 327 328 Type: `string` 329 Default: `""` 330 331 ### `tls.client_certs[].key` 332 333 A plain text certificate key to use. 334 335 336 Type: `string` 337 Default: `""` 338 339 ### `tls.client_certs[].cert_file` 340 341 The path to a certificate to use. 342 343 344 Type: `string` 345 Default: `""` 346 347 ### `tls.client_certs[].key_file` 348 349 The path of a certificate key to use. 350 351 352 Type: `string` 353 Default: `""` 354 355