redpanda_common
|
Deprecated in 4.68.0
This component is deprecated and will be removed in the next major version release. Please consider moving onto the unified |
Consumes data from a Redpanda (Kafka) broker, using credentials from a common redpanda configuration block.
To avoid duplicating Redpanda cluster credentials in your redpanda_common input, output, or any other components in your data pipeline, you can use a single redpanda configuration block. For more details, see the Pipeline example.
Introduced in version 4.39.0.
If you need to move topic data between Redpanda clusters or other Apache Kafka clusters, consider using the redpanda input and output instead.
|
-
Common
-
Advanced
input:
label: ""
redpanda_common:
topics: [] # No default (optional)
regexp_topics_include: [] # No default (optional)
regexp_topics_exclude: [] # No default (optional)
transaction_isolation_level: read_uncommitted
consumer_group: "" # No default (optional)
auto_replay_nacks: true
input:
label: ""
redpanda_common:
topics: [] # No default (optional)
regexp_topics_include: [] # No default (optional)
regexp_topics_exclude: [] # No default (optional)
rack_id: ""
instance_id: ""
rebalance_timeout: 45s
session_timeout: 1m
heartbeat_interval: 3s
start_offset: earliest
fetch_max_bytes: 50MiB
fetch_max_wait: 5s
fetch_min_bytes: 1B
fetch_max_partition_bytes: 1MiB
transaction_isolation_level: read_uncommitted
consumer_group: "" # No default (optional)
commit_period: 5s
partition_buffer_bytes: 1MB
topic_lag_refresh_period: 5s
max_yield_batch_bytes: 32KB
auto_replay_nacks: true
timely_nacks_maximum_wait: "" # No default (optional)
Pipeline example
This data pipeline reads data from topic_A and topic_B on a Redpanda cluster, and then writes the data to topic_C on the same cluster. The cluster details are configured within the redpanda configuration block, so you only need to configure them once. This is a useful feature when you have multiple inputs and outputs in the same data pipeline that need to connect to the same cluster.
input:
redpanda_common:
topics: [ topic_A, topic_B ]
output:
redpanda_common:
topic: topic_C
key: ${! @id }
redpanda:
seed_brokers: [ "127.0.0.1:9092" ]
tls:
enabled: true
sasl:
- mechanism: SCRAM-SHA-512
password: bar
username: foo
Consumer groups
When you specify a consumer group in your configuration, this input consumes one or more topics and automatically balances the topic partitions across any other connected clients with the same consumer group. Otherwise, topics are consumed in their entirety or with explicit partitions.
Delivery guarantees
If you choose to use consumer groups, the offsets of records received by Redpanda Connect are committed automatically. In the event of restarts, this input uses the committed offsets to resume data consumption where it left off.
Redpanda Connect guarantees at-least-once delivery. Records are only confirmed as delivered when all downstream outputs that a record is routed to have also confirmed delivery.
Ordering
To preserve the order of topic partitions:
-
Records consumed from each partition are processed and delivered in the order that they are received
-
Only one batch of records of a given partition is processed at a time
This approach means that although records from different partitions may be processed in parallel, records from the same partition are processed in sequential order.
Delivery errors
The order in which records are delivered may be disrupted by delivery errors and any error-handling mechanisms that start up. Redpanda Connect uses at-least-once delivery unless instructed otherwise, and this includes reattempting delivery of data when the ordering of that data is no longer guaranteed.
For example, a batch of records is sent to an output broker and only a subset of records are delivered. In this scenario, Redpanda Connect (by default) attempts to deliver the records that failed, even though these delivery failures may have been sent before records that were delivered successfully.
Use a fallback output
To prevent delivery errors from disrupting the order of records, you must specify a fallback output in your pipeline configuration. When adding a fallback output, it is good practice to set the auto_retry_nacks field to false. This also improves the throughput of your pipeline.
For example, the following configuration includes a fallback output. If Redpanda Connect fails to write delivery errors to the foo topic, it then attempts to write them into a dead letter queue topic (foo_dlq), which is retried indefinitely as a way to apply back pressure.
output:
fallback:
- redpanda_common:
topic: foo
- retry:
output:
redpanda_common:
topic: foo_dlq
Batching
Records are processed and delivered from each partition in the same batches as they are received from brokers. Batch sizes are dynamically sized in order to optimize throughput, but you can tune them further using the following configuration fields:
-
fetch_max_partition_bytes -
fetch_max_bytes
You can break batches down further using the split processor.
Metrics
This input emits a redpanda_lag metric with topic and partition labels for each consumed topic. The metric records the number of produced messages that remain to be read from each topic/partition pair by the specified consumer group.
Metadata
This input adds the following metadata fields to each message:
-
kafka_key -
kafka_topic -
kafka_partition -
kafka_offset -
kafka_lag -
kafka_timestamp_ms -
kafka_timestamp_unix -
kafka_tombstone_message -
All record headers
Fields
auto_replay_nacks
Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure.
Set auto_replay_nacks to false to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation.
Type: bool
Default: true
commit_period
The period of time between each commit of the current partition offsets to the consumer group. Offsets are always committed during shutdown.
Type: string
Default: 5s
consumer_group
An optional consumer group. When you specify this value:
-
The partitions of any topics specified in the
topicsfield are automatically distributed across consumers that share the consumer group. -
Partition offsets are automatically committed and resumed under this name.
Consumer groups are not supported when you specify explicit partitions to consume from in the topics field.
Type: string
fetch_max_bytes
The maximum number of bytes that a broker tries to send during a fetch.
If individual records are larger than the fetch_max_bytes value, brokers still send them.
This field is equivalent to the Java setting fetch.max.bytes.
Type: string
Default: 50MiB
fetch_max_partition_bytes
The maximum number of bytes that are consumed from a single partition in a fetch request. This field is equivalent to the Java setting fetch.max.partition.bytes.
If a single batch is larger than the fetch_max_partition_bytes value, the batch is still sent so that the client can make progress.
Type: string
Default: 1MiB
fetch_max_wait
The maximum period of time a broker can wait for a fetch response to reach the required minimum number of bytes (fetch_min_bytes). This field is equivalent to the Java setting fetch.max.wait.ms.
Requires version 4.45.0 or later.
Type: string
Default: 5s
fetch_min_bytes
The minimum number of bytes that a broker tries to send during a fetch. This field is equivalent to the Java setting fetch.min.bytes.
Type: string
Default: 1B
heartbeat_interval
When you specify a consumer_group, heartbeat_interval sets how frequently a consumer group member should send heartbeats to Apache Kafka. Apache Kafka uses heartbeats to make sure that a group member’s session is active.
This value must be lower than session_timeout, and should be no higher than one-third of session_timeout.
This field is equivalent to the Java heartbeat.interval.ms setting and accepts Go duration format strings such as 10s or 2m.
Requires version 4.46.0 or later.
Type: string
Default: 3s
instance_id
When you specify a consumer_group, set instance_id to define the group’s static membership, which can prevent unnecessary rebalances during reconnections. The value must be unique per consumer within the group.
When you assign an instance ID, the client does not leave the consumer group when it closes. To remove the client from the group, you must use an external admin command on behalf of the instance ID.
Requires version 4.46.0 or later.
Type: string
Default: ""
max_yield_batch_bytes
The maximum size (in bytes) for each batch yielded by this input. This value must be less than or equal to the partition_buffer_bytes. If using Redpanda output, this value should not be greater than the max_message_bytes option value (1MB by default), and for high-throughput scenarios they should be equal.
Requires version 4.55.0 or later.
Type: string
Default: 32KB
partition_buffer_bytes
A buffer size (in bytes) for each consumed partition, which allows the internal queuing of records before they are flushed. Increasing this value may improve throughput but results in higher memory utilization.
Each buffer can grow slightly beyond this value.
Type: string
Default: 1MB
rack_id
A rack specifies where the client is physically located, and changes fetch requests to consume from the closest replica as opposed to the leader replica.
Type: string
Default: ""
rebalance_timeout
When you specify a consumer_group, rebalance_timeout sets how long consumer group members can take to complete their work and commit offsets after a rebalance has begun. The time that a member takes to detect the rebalance (from a heartbeat) counts against this timeout. This field accepts Go duration format strings such as 100ms, 1s, or 5s.
Requires version 4.46.0 or later.
Type: string
Default: 45s
regexp_topics_exclude[]
A list of regular expression patterns for excluding topics when regex mode is enabled (using regexp_topics_include or the deprecated regexp_topics boolean). Topics matching any of these patterns will be excluded from consumption, even if they match include patterns.
Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so use ^ and $ for exact matching. Exclude patterns are applied after include patterns, providing fine-grained control over topic selection.
Example: regexp_topics_exclude: ["^_", ".-temp$", ".-test.*"] excludes topics starting with underscore, ending with -temp, or containing -test.
Requires version 4.69.0 or later.
Type: array<string>
regexp_topics_include[]
A list of regular expression patterns for matching topics to consume from. When specified, the client will periodically refresh the list of matching topics based on the metadata_max_age interval.
Each pattern is a full regular expression evaluated against the complete topic name. Patterns are not anchored by default, so logs_. matches my-logs_events and logs_errors. Use ^logs_.$ to match only topics starting with logs_.
This field enables regex mode (replacing the deprecated regexp_topics boolean) and cannot be used together with explicit topics lists. Use regexp_topics_exclude to filter out specific patterns from the matched topics.
Example: regexp_topics_include: ["events_.", "logs_."] consumes from all topics starting with events_ or logs_.
Requires version 4.69.0 or later.
Type: array<string>
# Examples:
regexp_topics_include:
- logs_.*
- metrics_.*
# ---
regexp_topics_include:
- "events_[0-9]+"
session_timeout
When you specify a consumer_group, session_timeout sets the maximum interval between heartbeats sent by a consumer group member to the broker. If a broker doesn’t receive a heartbeat from a group member before the timeout expires, it removes the member from the consumer group and initiates a rebalance. This field accepts Go duration format strings such as 100ms, 1s, or 5s.
Requires version 4.46.0 or later.
Type: string
Default: 1m
start_offset
Specify the offset from which this input starts or restarts consuming messages. Restarts occur when the OffsetOutOfRange error is seen during a fetch.
Requires version 4.53.0 or later.
Type: string
Default: earliest
| Option | Summary |
|---|---|
|
Prevents consuming a partition in a group if the partition has no prior commits. Corresponds to Kafka’s |
|
Start from the earliest offset. Corresponds to Kafka’s |
|
Start from the latest offset. Corresponds to Kafka’s |
timely_nacks_maximum_wait
EXPERIMENTAL: Specify a maximum period of time in which each message can be consumed and awaiting either acknowledgement or rejection before rejection is instead forced. This can be useful for avoiding situations where certain downstream components can result in blocked confirmation of delivery that exceeds SLAs. Accepts Go duration format strings such as 100ms, 1s, or 5s.
Requires version 4.62.0 or later.
Type: string
topic_lag_refresh_period
The interval between consumer lag refreshes. During each cycle, this input asks the brokers for the consumer group’s committed offsets and the partition end offsets, and records the difference (the number of unread messages) for each topic partition in the consumer lag metric and the kafka_lag metadata field. Lag is only refreshed when consumer_group is set. This field accepts Go duration format strings such as 100ms, 1s, or 5s.
Type: string
Default: 5s
topics[]
A list of topics to consume from. You can list multiple comma-separated topics in a single element.
If you specify a consumer_group, partitions are automatically distributed across consumers of a topic. Otherwise, all partitions are consumed.
Alternatively, add a colon after the topic name to set the explicit partitions to consume. For example, foo:0 consumes the partition 0 of the topic foo. This syntax also supports ranges. For example, foo:0-10 consumes all partitions from 0 through to 10 inclusive.
Finally, add another colon after the partition to set an explicit offset to consume from. For example, foo:0:10 consumes the partition 0 of the topic foo starting from the offset 10. If the offset is not present (or remains unspecified) then the field start_offset determines which offset to start from.
Type: array<string>
# Examples:
topics:
- foo
- bar
# ---
topics:
- things.*
# ---
topics:
- "foo,bar"
# ---
topics:
- "foo:0"
- "bar:1"
- "bar:3"
# ---
topics:
- "foo:0,bar:1,bar:3"
# ---
topics:
- "foo:0-5"
transaction_isolation_level
The isolation level for handling transactional messages. This setting determines how transactions are processed and affects data consistency guarantees.
Requires version 4.53.0 or later.
Type: string
Default: read_uncommitted
| Option | Summary |
|---|---|
|
If set, only committed transactional records are processed. |
|
If set, then uncommitted records are processed. |