Skip to content

Commit

Permalink
Use the subscription name defined in function details in the Pulsar F…
Browse files Browse the repository at this point in the history
…unctions Python instance

- the previous dsPatchFunctionNameAsSubscriptionName change requires
  this bug to be fixed
  • Loading branch information
lhotari committed Jun 23, 2021
1 parent b2e95a6 commit 282f831
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pulsar-functions/instance/src/main/python/python_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ def run(self):
if self.instance_config.function_details.source.subscriptionType == Function_pb2.SubscriptionType.Value("FAILOVER"):
mode = pulsar._pulsar.ConsumerType.Failover

subscription_name = str(self.instance_config.function_details.tenant) + "/" + \
str(self.instance_config.function_details.namespace) + "/" + \
str(self.instance_config.function_details.name)
subscription_name = self.instance_config.function_details.source.subscriptionName

if not (subscription_name and subscription_name.strip()):
subscription_name = str(self.instance_config.function_details.tenant) + "/" + \
str(self.instance_config.function_details.namespace) + "/" + \
str(self.instance_config.function_details.name)

properties = util.get_properties(util.getFullyQualifiedFunctionName(
self.instance_config.function_details.tenant,
Expand Down

0 comments on commit 282f831

Please sign in to comment.