drop
Silently discards all messages without error or side effects.
The drop output is a utility component that drops messages from the pipeline. Unlike filtering or conditional processors that modify or route messages, drop consumes messages and does nothing with them. This is useful for:
-
Testing and debugging: Measure input throughput without output bottlenecks
-
Conditional workflows: Discard messages that don’t meet certain criteria
-
Dead letter queue patterns: Provide a final fallback when all other outputs fail
-
Development: Temporarily disable output while testing pipeline logic
Use this reference to:
-
Look up drop output syntax and configuration
-
Find examples of drop in conditional routing
-
Identify use cases for drop output in pipelines
outputs:
label: ""
drop: {}
Performance
The drop output has minimal overhead and immediately acknowledges messages. This makes it ideal for performance testing, as it removes output processing time from measurements.
Examples
Conditional filtering
Use drop with the switch output to conditionally discard messages:
output:
switch:
cases:
- check: this.type == "error"
output:
label: error_sink
kafka:
addresses: ["kafka:9092"]
topic: errors
- check: this.type == "debug"
output:
label: drop_debug
drop: {} # Don't process debug messages in production
- output:
label: main_sink
kafka:
addresses: ["kafka:9092"]
topic: events
Dead letter queue pattern
Use drop as a last resort in a fallback chain:
output:
fallback:
- kafka:
addresses: ["kafka:9092"]
topic: primary_topic
max_in_flight: 1
- kafka:
addresses: ["kafka:9092"]
topic: dlq_topic
- drop: {} # Last resort: drop if both outputs fail
Testing input throughput
Measure how fast your input can consume data without output bottlenecks:
input:
kafka:
addresses: ["kafka:9092"]
topics: ["test"]
output:
drop: {} # Measure input consumption speed without output overhead
For more patterns on message routing, filtering, and when to use drop vs. other approaches, see the Message Routing Patterns cookbook.