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
  • Loading branch information
cdbartholomew authored and zzzming committed Dec 24, 2020
1 parent 3d13451 commit 4bb9056
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 @@ -108,7 +108,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 4bb9056

Please sign in to comment.