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

     1  ---
     2  title: sync_response
     3  type: output
     4  status: stable
     5  categories: ["Utility"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/output/sync_response.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  
    19  Returns the final message payload back to the input origin of the message, where
    20  it is dealt with according to that specific input type.
    21  
    22  ```yaml
    23  # Config fields, showing default values
    24  output:
    25    label: ""
    26    sync_response: {}
    27  ```
    28  
    29  For most inputs this mechanism is ignored entirely, in which case the sync
    30  response is dropped without penalty. It is therefore safe to use this output
    31  even when combining input types that might not have support for sync responses.
    32  An example of an input able to utilise this is the `http_server`.
    33  
    34  It is safe to combine this output with others using broker types. For example,
    35  with the `http_server` input we could send the payload to a Kafka
    36  topic and also send a modified payload back with:
    37  
    38  ```yaml
    39  input:
    40    http_server:
    41      path: /post
    42  output:
    43    broker:
    44      pattern: fan_out
    45      outputs:
    46        - kafka:
    47            addresses: [ TODO:9092 ]
    48            topic: foo_topic
    49        - sync_response: {}
    50          processors:
    51            - bloblang: 'root = content().uppercase()'
    52  ```
    53  
    54  Using the above example and posting the message 'hello world' to the endpoint
    55  `/post` Benthos would send it unchanged to the topic
    56  `foo_topic` and also respond with 'HELLO WORLD'.
    57  
    58  For more information please read [Synchronous Responses](/docs/guides/sync_responses).
    59  
    60