Skip to content

Commit

Permalink
Refactor key constructing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Feb 17, 2025
1 parent 9ec57b7 commit 54e08e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ballerina/hub_controller.bal
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public isolated class Controller {
}
}

// todo: implement this logic properly
isolated function retrieveKey(Subscription|Unsubscription message) returns string {
string 'key = message.toJsonString().trim();
return 'key;
isolated function retrieveKey(record {} message) returns string {
string[] keyValuePairs = [];
foreach var [_, value] in message.entries() {
keyValuePairs.push(string `${value.toString()}`);
}
return string:'join(":::", ...keyValuePairs);
}

0 comments on commit 54e08e6

Please sign in to comment.