github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/outputs/reject.md (about) 1 --- 2 title: reject 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/reject.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 19 Rejects all messages, treating them as though the output destination failed to publish them. 20 21 ```yaml 22 # Config fields, showing default values 23 output: 24 label: "" 25 reject: "" 26 ``` 27 28 The routing of messages after this output depends on the type of input it came from. For inputs that support propagating nacks upstream such as AMQP or NATS the message will be nacked. However, for inputs that are sequential such as files or Kafka the messages will simply be reprocessed from scratch. 29 30 If you're still scratching your head as to when this output could be useful check out [the examples below](#examples). 31 32 ## Examples 33 34 <Tabs defaultValue="Rejecting Failed Messages" values={[ 35 { label: 'Rejecting Failed Messages', value: 'Rejecting Failed Messages', }, 36 ]}> 37 38 <TabItem value="Rejecting Failed Messages"> 39 40 41 This input is particularly useful for routing messages that have failed during processing, where instead of routing them to some sort of dead letter queue we wish to push the error upstream. We can do this with a switch broker: 42 43 ```yaml 44 output: 45 switch: 46 retry_until_success: false 47 cases: 48 - check: '!errored()' 49 output: 50 amqp_1: 51 url: amqps://guest:guest@localhost:5672/ 52 target_address: queue:/the_foos 53 54 - output: 55 reject: "processing failed due to: ${! error() }" 56 ``` 57 58 </TabItem> 59 </Tabs> 60 61