Skip to content

Commit

Permalink
Changing default function subscription to be function name, not FQFN
Browse files Browse the repository at this point in the history
(cherry picked from commit 4bb9056)
  • Loading branch information
cdbartholomew authored and eolivelli committed May 7, 2021
1 parent e03a65f commit 186e63b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public Function.FunctionDetails.ComponentType calculateSubjectType(Function.Func
}

public static String getDefaultSubscriptionName(String tenant, String namespace, String name) {
return FunctionCommon.getFullyQualifiedName(tenant, namespace, name);
// Hacking this to just return the function name. Using a FQFN breaks the REST endpoints
// that deal with subscriptions
return name;
}

public static String getDefaultSubscriptionName(Function.FunctionDetails functionDetails) {
Expand Down
5 changes: 2 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,8 @@ 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)
# Default subscription to function name
subscription_name = 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 186e63b

Please sign in to comment.