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

     1  ---
     2  title: redis_pubsub
     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/redis_pubsub.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  
    19  Publishes messages through the Redis PubSub model. It is not possible to
    20  guarantee that messages have been received.
    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    redis_pubsub:
    35      url: tcp://localhost:6379
    36      channel: benthos_chan
    37      max_in_flight: 1
    38      batching:
    39        count: 0
    40        byte_size: 0
    41        period: ""
    42        check: ""
    43  ```
    44  
    45  </TabItem>
    46  <TabItem value="advanced">
    47  
    48  ```yaml
    49  # All config fields, showing default values
    50  output:
    51    label: ""
    52    redis_pubsub:
    53      url: tcp://localhost:6379
    54      kind: simple
    55      master: ""
    56      tls:
    57        enabled: false
    58        skip_cert_verify: false
    59        enable_renegotiation: false
    60        root_cas: ""
    61        root_cas_file: ""
    62        client_certs: []
    63      channel: benthos_chan
    64      max_in_flight: 1
    65      batching:
    66        count: 0
    67        byte_size: 0
    68        period: ""
    69        check: ""
    70        processors: []
    71  ```
    72  
    73  </TabItem>
    74  </Tabs>
    75  
    76  This output will interpolate functions within the channel field, you
    77  can find a list of functions [here](/docs/configuration/interpolation#bloblang-queries).
    78  
    79  ## Performance
    80  
    81  This output benefits from sending multiple messages in flight in parallel for
    82  improved performance. You can tune the max number of in flight messages with the
    83  field `max_in_flight`.
    84  
    85  This output benefits from sending messages as a batch for improved performance.
    86  Batches can be formed at both the input and output level. You can find out more
    87  [in this doc](/docs/configuration/batching).
    88  
    89  ## Fields
    90  
    91  ### `url`
    92  
    93  The URL of the target Redis server. Database is optional and is supplied as the URL path. The scheme `tcp` is equivalent to `redis`.
    94  
    95  
    96  Type: `string`  
    97  Default: `"tcp://localhost:6379"`  
    98  
    99  ```yaml
   100  # Examples
   101  
   102  url: :6397
   103  
   104  url: localhost:6397
   105  
   106  url: redis://localhost:6379
   107  
   108  url: redis://:foopassword@redisplace:6379
   109  
   110  url: redis://localhost:6379/1
   111  
   112  url: redis://localhost:6379/1,redis://localhost:6380/1
   113  ```
   114  
   115  ### `kind`
   116  
   117  Specifies a simple, cluster-aware, or failover-aware redis client.
   118  
   119  
   120  Type: `string`  
   121  Default: `"simple"`  
   122  
   123  ```yaml
   124  # Examples
   125  
   126  kind: simple
   127  
   128  kind: cluster
   129  
   130  kind: failover
   131  ```
   132  
   133  ### `master`
   134  
   135  Name of the redis master when `kind` is `failover`
   136  
   137  
   138  Type: `string`  
   139  Default: `""`  
   140  
   141  ```yaml
   142  # Examples
   143  
   144  master: mymaster
   145  ```
   146  
   147  ### `tls`
   148  
   149  Custom TLS settings can be used to override system defaults.
   150  
   151  **Troubleshooting**
   152  
   153  Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you're using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2.
   154  
   155  
   156  Type: `object`  
   157  
   158  ### `tls.enabled`
   159  
   160  Whether custom TLS settings are enabled.
   161  
   162  
   163  Type: `bool`  
   164  Default: `false`  
   165  
   166  ### `tls.skip_cert_verify`
   167  
   168  Whether to skip server side certificate verification.
   169  
   170  
   171  Type: `bool`  
   172  Default: `false`  
   173  
   174  ### `tls.enable_renegotiation`
   175  
   176  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`.
   177  
   178  
   179  Type: `bool`  
   180  Default: `false`  
   181  Requires version 3.45.0 or newer  
   182  
   183  ### `tls.root_cas`
   184  
   185  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.
   186  
   187  
   188  Type: `string`  
   189  Default: `""`  
   190  
   191  ```yaml
   192  # Examples
   193  
   194  root_cas: |-
   195    -----BEGIN CERTIFICATE-----
   196    ...
   197    -----END CERTIFICATE-----
   198  ```
   199  
   200  ### `tls.root_cas_file`
   201  
   202  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.
   203  
   204  
   205  Type: `string`  
   206  Default: `""`  
   207  
   208  ```yaml
   209  # Examples
   210  
   211  root_cas_file: ./root_cas.pem
   212  ```
   213  
   214  ### `tls.client_certs`
   215  
   216  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.
   217  
   218  
   219  Type: `array`  
   220  Default: `[]`  
   221  
   222  ```yaml
   223  # Examples
   224  
   225  client_certs:
   226    - cert: foo
   227      key: bar
   228  
   229  client_certs:
   230    - cert_file: ./example.pem
   231      key_file: ./example.key
   232  ```
   233  
   234  ### `tls.client_certs[].cert`
   235  
   236  A plain text certificate to use.
   237  
   238  
   239  Type: `string`  
   240  Default: `""`  
   241  
   242  ### `tls.client_certs[].key`
   243  
   244  A plain text certificate key to use.
   245  
   246  
   247  Type: `string`  
   248  Default: `""`  
   249  
   250  ### `tls.client_certs[].cert_file`
   251  
   252  The path to a certificate to use.
   253  
   254  
   255  Type: `string`  
   256  Default: `""`  
   257  
   258  ### `tls.client_certs[].key_file`
   259  
   260  The path of a certificate key to use.
   261  
   262  
   263  Type: `string`  
   264  Default: `""`  
   265  
   266  ### `channel`
   267  
   268  The channel to publish messages to.
   269  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   270  
   271  
   272  Type: `string`  
   273  Default: `"benthos_chan"`  
   274  
   275  ### `max_in_flight`
   276  
   277  The maximum number of messages to have in flight at a given time. Increase this to improve throughput.
   278  
   279  
   280  Type: `int`  
   281  Default: `1`  
   282  
   283  ### `batching`
   284  
   285  Allows you to configure a [batching policy](/docs/configuration/batching).
   286  
   287  
   288  Type: `object`  
   289  
   290  ```yaml
   291  # Examples
   292  
   293  batching:
   294    byte_size: 5000
   295    count: 0
   296    period: 1s
   297  
   298  batching:
   299    count: 10
   300    period: 1s
   301  
   302  batching:
   303    check: this.contains("END BATCH")
   304    count: 0
   305    period: 1m
   306  ```
   307  
   308  ### `batching.count`
   309  
   310  A number of messages at which the batch should be flushed. If `0` disables count based batching.
   311  
   312  
   313  Type: `int`  
   314  Default: `0`  
   315  
   316  ### `batching.byte_size`
   317  
   318  An amount of bytes at which the batch should be flushed. If `0` disables size based batching.
   319  
   320  
   321  Type: `int`  
   322  Default: `0`  
   323  
   324  ### `batching.period`
   325  
   326  A period in which an incomplete batch should be flushed regardless of its size.
   327  
   328  
   329  Type: `string`  
   330  Default: `""`  
   331  
   332  ```yaml
   333  # Examples
   334  
   335  period: 1s
   336  
   337  period: 1m
   338  
   339  period: 500ms
   340  ```
   341  
   342  ### `batching.check`
   343  
   344  A [Bloblang query](/docs/guides/bloblang/about/) that should return a boolean value indicating whether a message should end a batch.
   345  
   346  
   347  Type: `string`  
   348  Default: `""`  
   349  
   350  ```yaml
   351  # Examples
   352  
   353  check: this.type == "end_of_transaction"
   354  ```
   355  
   356  ### `batching.processors`
   357  
   358  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.
   359  
   360  
   361  Type: `array`  
   362  Default: `[]`  
   363  
   364  ```yaml
   365  # Examples
   366  
   367  processors:
   368    - archive:
   369        format: lines
   370  
   371  processors:
   372    - archive:
   373        format: json_array
   374  
   375  processors:
   376    - merge_json: {}
   377  ```
   378  
   379