Skip to content
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
4 changes: 2 additions & 2 deletions src/implementation/Server/GRPCServer/GRPCServerImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default class GRPCServerImpl implements IAppCallbackServer {
return;
}

const [topic, route] = this.subscriptionManager.lookupTopicWilcard(pubsub, req.getTopic(), req.getPath());
const [topic, route] = this.subscriptionManager.lookupTopicWildcard(pubsub, req.getTopic(), req.getPath());
if (topic == "") {
this.logger.warn(`Topic '${topic}' has not been subscribed to pubsub '${pubsub}', ignoring event.`);
return;
Expand Down Expand Up @@ -267,7 +267,7 @@ export default class GRPCServerImpl implements IAppCallbackServer {
return;
}

const [topic, route] = this.subscriptionManager.lookupTopicWilcard(pubsub, req.getTopic(), req.getPath());
const [topic, route] = this.subscriptionManager.lookupTopicWildcard(pubsub, req.getTopic(), req.getPath());
if (topic == "") {
this.logger.warn(`Topic '${topic}' has not been subscribed to pubsub '${pubsub}', ignoring bulk event.`);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/pubsub/subscriptionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ export class SubscriptionManager {
}

/**
* Lookup the topic and route for a given pubsub, topic (with wilcard support) and path.
* Lookup the topic and route for a given pubsub, topic (with wildcard support) and path.
* If not found, topic is empty.
* @param pubsub name of the pubsub component
* @param topic name of the topic
* @param path path from the event
* @returns the topic and route
*/
public lookupTopicWilcard(pubsub: string, topic: string, path: string): [string, string] {
public lookupTopicWildcard(pubsub: string, topic: string, path: string): [string, string] {
if (!this.isPubSubRegistered(pubsub)) {
return ["", ""];
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/protocols/common/subscriptionManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("subscriptionManager", () => {
describe("lookupTopicWildcard", () => {
it("should return an empty topic and route if the pubsub is not registered", () => {
const sm = new SubscriptionManager();
const res = sm.lookupTopicWilcard("pubsub", "topic", "route");
const res = sm.lookupTopicWildcard("pubsub", "topic", "route");

expect(res[0]).toEqual("");
expect(res[1]).toEqual("");
Expand All @@ -27,7 +27,7 @@ describe("subscriptionManager", () => {
const sm = new SubscriptionManager();
sm.registerSubscription("pubsub", "topic", {});

const res = sm.lookupTopicWilcard("pubsub", "topic-undefined", "route");
const res = sm.lookupTopicWildcard("pubsub", "topic-undefined", "route");

expect(res[0]).toEqual("");
expect(res[1]).toEqual("");
Expand Down
4 changes: 2 additions & 2 deletions test/unit/protocols/grpc/GRPCServerImpl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("GRPCServerImpl", () => {
// @ts-ignore
g.subscriptionManager = {
isPubSubRegistered: () => true,
lookupTopicWilcard: () => ["", ""],
lookupTopicWildcard: () => ["", ""],
};

await g.onTopicEvent(
Expand Down Expand Up @@ -111,7 +111,7 @@ describe("GRPCServerImpl", () => {
// @ts-ignore
g.subscriptionManager = {
isPubSubRegistered: () => true,
lookupTopicWilcard: () => ["", ""],
lookupTopicWildcard: () => ["", ""],
};

await g.onBulkTopicEventAlpha1(
Expand Down