Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAPI] Support setting priority for consumers #12526

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pulsar-client-cpp/include/pulsar/c/consumer_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ PULSAR_PUBLIC void pulsar_consumer_set_subscription_initial_position(
PULSAR_PUBLIC void pulsar_consumer_configuration_set_property(pulsar_consumer_configuration_t *conf,
const char *name, const char *value);

PULSAR_PUBLIC void pulsar_consumer_configuration_set_priority_level(
pulsar_consumer_configuration_t *consumer_configuration, int priority_level);

PULSAR_PUBLIC int pulsar_consumer_configuration_get_priority_level(
pulsar_consumer_configuration_t *consumer_configuration);

// const CryptoKeyReaderPtr getCryptoKeyReader()
//
// const;
Expand Down
10 changes: 10 additions & 0 deletions pulsar-client-cpp/lib/c/c_ConsumerConfiguration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,13 @@ int pulsar_consumer_get_subscription_initial_position(
pulsar_consumer_configuration_t *consumer_configuration) {
return consumer_configuration->consumerConfiguration.getSubscriptionInitialPosition();
}

void pulsar_consumer_configuration_set_priority_level(pulsar_consumer_configuration_t *consumer_configuration,
int priority_level) {
consumer_configuration->consumerConfiguration.setPriorityLevel(priority_level);
}

int pulsar_consumer_configuration_get_priority_level(
pulsar_consumer_configuration_t *consumer_configuration) {
return consumer_configuration->consumerConfiguration.getPriorityLevel();
}