You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.
The Pulsar Java consumer supports setting a priority level for priority message
dispatch in shared subscription consumers and priority assignment in failover
subscription consumers. See the ConsumerBuilder.html#priorityLevel(int)
Javadoc
for a detailed functional description. The Pulsar Java consumer also supports
consuming from multiple topics. However, it is not possible to set a different
priority level for different topics in the same Consumer instance.
This behaviour is desirable in some use cases. For example, a consumer
processing region specific topics might wish to configure region stickiness - A
multi-region application might be consuming from topics events-us-east-1 and
events-eu-west-1. Consumers in all regions should be configured to consume all
topics to ensure data completeness. However, to ensure low latency, the
us-east-1 consumer would need to set a higher priority level for the us-east-1
topic. Similarly, the eu-west-1 consumer would need to set a higher priority
level for the eu-west-1 topic.
Goal
Update the Java client API to allow the configuration of different priority
levels for different topics.
Do so in such a way that supports the addition of other topic specific
configuration options or overrides in the future.
Issues will be created to track feature parity in the other client
implementations for this PIP.
API Changes
In pulsar-client-api, update ConsumerBuilder to include two new methods:
Then, in ConsumerImpl the appropriate topic configuration can be selected
based on the topic being subscribed to. Since the topic configuration is
effectively keyed by a topic name or pattern, it’s possible for the user to be
able configure multiple topic configurations that match the same concrete topic
name. In this case the first topic name match should be selected.
Original Issue: apache#16481
Motivation
The Pulsar Java consumer supports setting a priority level for priority message
dispatch in shared subscription consumers and priority assignment in failover
subscription consumers. See the ConsumerBuilder.html#priorityLevel(int)
Javadoc
for a detailed functional description. The Pulsar Java consumer also supports
consuming from multiple topics. However, it is not possible to set a different
priority level for different topics in the same Consumer instance.
This behaviour is desirable in some use cases. For example, a consumer
processing region specific topics might wish to configure region stickiness - A
multi-region application might be consuming from topics events-us-east-1 and
events-eu-west-1. Consumers in all regions should be configured to consume all
topics to ensure data completeness. However, to ensure low latency, the
us-east-1 consumer would need to set a higher priority level for the us-east-1
topic. Similarly, the eu-west-1 consumer would need to set a higher priority
level for the eu-west-1 topic.
Goal
Update the Java client API to allow the configuration of different priority
levels for different topics.
Do so in such a way that supports the addition of other topic specific
configuration options or overrides in the future.
Issues will be created to track feature parity in the other client
implementations for this PIP.
API Changes
In pulsar-client-api, update
ConsumerBuilder
to include two new methods:Create a new interface:
In pulsar-client-original, update
ConsumerConfigurationData
to include a new field:Create a topic configuration class:
Then, in
ConsumerImpl
the appropriate topic configuration can be selectedbased on the topic being subscribed to. Since the topic configuration is
effectively keyed by a topic name or pattern, it’s possible for the user to be
able configure multiple topic configurations that match the same concrete topic
name. In this case the first topic name match should be selected.
Example Usage:
or
Rejected Alternatives
ConsumerBuilder
rather than introducing a nested, topic specific builder class.Rejection reason: Does not provide a clear API to discover and extend other topic specific configuration options and overrides.
Example usage:
Rejection reason: Not compatible with
ConsumerBuilder.loadConf
.Example usage:
The text was updated successfully, but these errors were encountered: