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

     1  ---
     2  title: redis
     3  type: cache
     4  status: stable
     5  ---
     6  
     7  <!--
     8       THIS FILE IS AUTOGENERATED!
     9  
    10       To make changes please edit the contents of:
    11       lib/cache/redis.go
    12  -->
    13  
    14  import Tabs from '@theme/Tabs';
    15  import TabItem from '@theme/TabItem';
    16  
    17  
    18  Use a Redis instance as a cache. The expiration can be set to zero or an empty
    19  string in order to set no expiration.
    20  
    21  
    22  <Tabs defaultValue="common" values={[
    23    { label: 'Common', value: 'common', },
    24    { label: 'Advanced', value: 'advanced', },
    25  ]}>
    26  
    27  <TabItem value="common">
    28  
    29  ```yaml
    30  # Common config fields, showing default values
    31  label: ""
    32  redis:
    33    url: tcp://localhost:6379
    34    prefix: ""
    35    expiration: 24h
    36  ```
    37  
    38  </TabItem>
    39  <TabItem value="advanced">
    40  
    41  ```yaml
    42  # All config fields, showing default values
    43  label: ""
    44  redis:
    45    url: tcp://localhost:6379
    46    kind: simple
    47    master: ""
    48    tls:
    49      enabled: false
    50      skip_cert_verify: false
    51      enable_renegotiation: false
    52      root_cas: ""
    53      root_cas_file: ""
    54      client_certs: []
    55    prefix: ""
    56    expiration: 24h
    57    retries: 3
    58    retry_period: 500ms
    59  ```
    60  
    61  </TabItem>
    62  </Tabs>
    63  
    64  
    65  This cache type supports setting the TTL individually per key by using the
    66  dynamic `ttl` field of a cache processor or output in order to
    67  override the general TTL configured at the cache resource level.
    68  
    69  ## Fields
    70  
    71  ### `url`
    72  
    73  The URL of the target Redis server. Database is optional and is supplied as the URL path. The scheme `tcp` is equivalent to `redis`.
    74  
    75  
    76  Type: `string`  
    77  Default: `"tcp://localhost:6379"`  
    78  
    79  ```yaml
    80  # Examples
    81  
    82  url: :6397
    83  
    84  url: localhost:6397
    85  
    86  url: redis://localhost:6379
    87  
    88  url: redis://:foopassword@redisplace:6379
    89  
    90  url: redis://localhost:6379/1
    91  
    92  url: redis://localhost:6379/1,redis://localhost:6380/1
    93  ```
    94  
    95  ### `kind`
    96  
    97  Specifies a simple, cluster-aware, or failover-aware redis client.
    98  
    99  
   100  Type: `string`  
   101  Default: `"simple"`  
   102  
   103  ```yaml
   104  # Examples
   105  
   106  kind: simple
   107  
   108  kind: cluster
   109  
   110  kind: failover
   111  ```
   112  
   113  ### `master`
   114  
   115  Name of the redis master when `kind` is `failover`
   116  
   117  
   118  Type: `string`  
   119  Default: `""`  
   120  
   121  ```yaml
   122  # Examples
   123  
   124  master: mymaster
   125  ```
   126  
   127  ### `tls`
   128  
   129  Custom TLS settings can be used to override system defaults.
   130  
   131  **Troubleshooting**
   132  
   133  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.
   134  
   135  
   136  Type: `object`  
   137  
   138  ### `tls.enabled`
   139  
   140  Whether custom TLS settings are enabled.
   141  
   142  
   143  Type: `bool`  
   144  Default: `false`  
   145  
   146  ### `tls.skip_cert_verify`
   147  
   148  Whether to skip server side certificate verification.
   149  
   150  
   151  Type: `bool`  
   152  Default: `false`  
   153  
   154  ### `tls.enable_renegotiation`
   155  
   156  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`.
   157  
   158  
   159  Type: `bool`  
   160  Default: `false`  
   161  Requires version 3.45.0 or newer  
   162  
   163  ### `tls.root_cas`
   164  
   165  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.
   166  
   167  
   168  Type: `string`  
   169  Default: `""`  
   170  
   171  ```yaml
   172  # Examples
   173  
   174  root_cas: |-
   175    -----BEGIN CERTIFICATE-----
   176    ...
   177    -----END CERTIFICATE-----
   178  ```
   179  
   180  ### `tls.root_cas_file`
   181  
   182  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.
   183  
   184  
   185  Type: `string`  
   186  Default: `""`  
   187  
   188  ```yaml
   189  # Examples
   190  
   191  root_cas_file: ./root_cas.pem
   192  ```
   193  
   194  ### `tls.client_certs`
   195  
   196  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.
   197  
   198  
   199  Type: `array`  
   200  Default: `[]`  
   201  
   202  ```yaml
   203  # Examples
   204  
   205  client_certs:
   206    - cert: foo
   207      key: bar
   208  
   209  client_certs:
   210    - cert_file: ./example.pem
   211      key_file: ./example.key
   212  ```
   213  
   214  ### `tls.client_certs[].cert`
   215  
   216  A plain text certificate to use.
   217  
   218  
   219  Type: `string`  
   220  Default: `""`  
   221  
   222  ### `tls.client_certs[].key`
   223  
   224  A plain text certificate key to use.
   225  
   226  
   227  Type: `string`  
   228  Default: `""`  
   229  
   230  ### `tls.client_certs[].cert_file`
   231  
   232  The path to a certificate to use.
   233  
   234  
   235  Type: `string`  
   236  Default: `""`  
   237  
   238  ### `tls.client_certs[].key_file`
   239  
   240  The path of a certificate key to use.
   241  
   242  
   243  Type: `string`  
   244  Default: `""`  
   245  
   246  ### `prefix`
   247  
   248  An optional string to prefix item keys with in order to prevent collisions with similar services.
   249  
   250  
   251  Type: `string`  
   252  Default: `""`  
   253  
   254  ### `expiration`
   255  
   256  An optional period after which cached items will expire.
   257  
   258  
   259  Type: `string`  
   260  Default: `"24h"`  
   261  
   262  ### `retries`
   263  
   264  The maximum number of retry attempts to make before abandoning a request.
   265  
   266  
   267  Type: `int`  
   268  Default: `3`  
   269  
   270  ### `retry_period`
   271  
   272  The duration to wait between retry attempts.
   273  
   274  
   275  Type: `string`  
   276  Default: `"500ms"`  
   277  
   278