github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/outputs/amqp_0_9.md (about)

     1  ---
     2  title: amqp_0_9
     3  type: output
     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/output/amqp_0_9.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  
    19  Sends messages to an AMQP (0.91) exchange. AMQP is a messaging protocol used by
    20  various 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  output:
    33    label: ""
    34    amqp_0_9:
    35      urls: []
    36      exchange: benthos-exchange
    37      key: benthos-key
    38      type: ""
    39      metadata:
    40        exclude_prefixes: []
    41      max_in_flight: 1
    42  ```
    43  
    44  </TabItem>
    45  <TabItem value="advanced">
    46  
    47  ```yaml
    48  # All config fields, showing default values
    49  output:
    50    label: ""
    51    amqp_0_9:
    52      urls: []
    53      exchange: benthos-exchange
    54      exchange_declare:
    55        enabled: false
    56        type: direct
    57        durable: true
    58      key: benthos-key
    59      type: ""
    60      content_type: application/octet-stream
    61      content_encoding: ""
    62      metadata:
    63        exclude_prefixes: []
    64      priority: ""
    65      max_in_flight: 1
    66      persistent: false
    67      mandatory: false
    68      immediate: false
    69      tls:
    70        enabled: false
    71        skip_cert_verify: false
    72        enable_renegotiation: false
    73        root_cas: ""
    74        root_cas_file: ""
    75        client_certs: []
    76  ```
    77  
    78  </TabItem>
    79  </Tabs>
    80  
    81  The metadata from each message are delivered as headers.
    82  
    83  It's possible for this output type to create the target exchange by setting
    84  `exchange_declare.enabled` to `true`, if the exchange already exists
    85  then the declaration passively verifies that the settings match.
    86  
    87  TLS is automatic when connecting to an `amqps` URL, but custom
    88  settings can be enabled in the `tls` section.
    89  
    90  The fields 'key' and 'type' can be dynamically set using function interpolations described
    91  [here](/docs/configuration/interpolation#bloblang-queries).
    92  
    93  ## Performance
    94  
    95  This output benefits from sending multiple messages in flight in parallel for
    96  improved performance. You can tune the max number of in flight messages with the
    97  field `max_in_flight`.
    98  
    99  ## Fields
   100  
   101  ### `urls`
   102  
   103  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.
   104  
   105  
   106  Type: `array`  
   107  Default: `[]`  
   108  Requires version 3.58.0 or newer  
   109  
   110  ```yaml
   111  # Examples
   112  
   113  urls:
   114    - amqp://guest:guest@127.0.0.1:5672/
   115  
   116  urls:
   117    - amqp://127.0.0.1:5672/,amqp://127.0.0.2:5672/
   118  
   119  urls:
   120    - amqp://127.0.0.1:5672/
   121    - amqp://127.0.0.2:5672/
   122  ```
   123  
   124  ### `exchange`
   125  
   126  An AMQP exchange to publish to.
   127  
   128  
   129  Type: `string`  
   130  Default: `"benthos-exchange"`  
   131  
   132  ### `exchange_declare`
   133  
   134  Optionally declare the target exchange (passive).
   135  
   136  
   137  Type: `object`  
   138  
   139  ### `exchange_declare.enabled`
   140  
   141  Whether to declare the exchange.
   142  
   143  
   144  Type: `bool`  
   145  Default: `false`  
   146  
   147  ### `exchange_declare.type`
   148  
   149  The type of the exchange.
   150  
   151  
   152  Type: `string`  
   153  Default: `"direct"`  
   154  Options: `direct`, `fanout`, `topic`, `x-custom`.
   155  
   156  ### `exchange_declare.durable`
   157  
   158  Whether the exchange should be durable.
   159  
   160  
   161  Type: `bool`  
   162  Default: `true`  
   163  
   164  ### `key`
   165  
   166  The binding key to set for each message.
   167  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   168  
   169  
   170  Type: `string`  
   171  Default: `"benthos-key"`  
   172  
   173  ### `type`
   174  
   175  The type property to set for each message.
   176  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   177  
   178  
   179  Type: `string`  
   180  Default: `""`  
   181  
   182  ### `content_type`
   183  
   184  The content type attribute to set for each message.
   185  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   186  
   187  
   188  Type: `string`  
   189  Default: `"application/octet-stream"`  
   190  
   191  ### `content_encoding`
   192  
   193  The content encoding attribute to set for each message.
   194  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   195  
   196  
   197  Type: `string`  
   198  Default: `""`  
   199  
   200  ### `metadata`
   201  
   202  Specify criteria for which metadata values are attached to messages as headers.
   203  
   204  
   205  Type: `object`  
   206  
   207  ### `metadata.exclude_prefixes`
   208  
   209  Provide a list of explicit metadata key prefixes to be excluded when adding metadata to sent messages.
   210  
   211  
   212  Type: `array`  
   213  Default: `[]`  
   214  
   215  ### `priority`
   216  
   217  Set the priority of each message with a dynamic interpolated expression.
   218  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   219  
   220  
   221  Type: `string`  
   222  Default: `""`  
   223  
   224  ```yaml
   225  # Examples
   226  
   227  priority: "0"
   228  
   229  priority: ${! meta("amqp_priority") }
   230  
   231  priority: ${! json("doc.priority") }
   232  ```
   233  
   234  ### `max_in_flight`
   235  
   236  The maximum number of messages to have in flight at a given time. Increase this to improve throughput.
   237  
   238  
   239  Type: `int`  
   240  Default: `1`  
   241  
   242  ### `persistent`
   243  
   244  Whether message delivery should be persistent (transient by default).
   245  
   246  
   247  Type: `bool`  
   248  Default: `false`  
   249  
   250  ### `mandatory`
   251  
   252  Whether to set the mandatory flag on published messages. When set if a published message is routed to zero queues it is returned.
   253  
   254  
   255  Type: `bool`  
   256  Default: `false`  
   257  
   258  ### `immediate`
   259  
   260  Whether to set the immediate flag on published messages. When set if there are no ready consumers of a queue then the message is dropped instead of waiting.
   261  
   262  
   263  Type: `bool`  
   264  Default: `false`  
   265  
   266  ### `tls`
   267  
   268  Custom TLS settings can be used to override system defaults.
   269  
   270  
   271  Type: `object`  
   272  
   273  ### `tls.enabled`
   274  
   275  Whether custom TLS settings are enabled.
   276  
   277  
   278  Type: `bool`  
   279  Default: `false`  
   280  
   281  ### `tls.skip_cert_verify`
   282  
   283  Whether to skip server side certificate verification.
   284  
   285  
   286  Type: `bool`  
   287  Default: `false`  
   288  
   289  ### `tls.enable_renegotiation`
   290  
   291  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`.
   292  
   293  
   294  Type: `bool`  
   295  Default: `false`  
   296  Requires version 3.45.0 or newer  
   297  
   298  ### `tls.root_cas`
   299  
   300  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.
   301  
   302  
   303  Type: `string`  
   304  Default: `""`  
   305  
   306  ```yaml
   307  # Examples
   308  
   309  root_cas: |-
   310    -----BEGIN CERTIFICATE-----
   311    ...
   312    -----END CERTIFICATE-----
   313  ```
   314  
   315  ### `tls.root_cas_file`
   316  
   317  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.
   318  
   319  
   320  Type: `string`  
   321  Default: `""`  
   322  
   323  ```yaml
   324  # Examples
   325  
   326  root_cas_file: ./root_cas.pem
   327  ```
   328  
   329  ### `tls.client_certs`
   330  
   331  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.
   332  
   333  
   334  Type: `array`  
   335  Default: `[]`  
   336  
   337  ```yaml
   338  # Examples
   339  
   340  client_certs:
   341    - cert: foo
   342      key: bar
   343  
   344  client_certs:
   345    - cert_file: ./example.pem
   346      key_file: ./example.key
   347  ```
   348  
   349  ### `tls.client_certs[].cert`
   350  
   351  A plain text certificate to use.
   352  
   353  
   354  Type: `string`  
   355  Default: `""`  
   356  
   357  ### `tls.client_certs[].key`
   358  
   359  A plain text certificate key to use.
   360  
   361  
   362  Type: `string`  
   363  Default: `""`  
   364  
   365  ### `tls.client_certs[].cert_file`
   366  
   367  The path to a certificate to use.
   368  
   369  
   370  Type: `string`  
   371  Default: `""`  
   372  
   373  ### `tls.client_certs[].key_file`
   374  
   375  The path of a certificate key to use.
   376  
   377  
   378  Type: `string`  
   379  Default: `""`  
   380  
   381