Skip to content

Instantly share code, notes, and snippets.

@ayeshLK
Created March 12, 2023 08:08
Show Gist options
  • Save ayeshLK/b884b670e31f4d659e596392c3fed2af to your computer and use it in GitHub Desktop.
Save ayeshLK/b884b670e31f4d659e596392c3fed2af to your computer and use it in GitHub Desktop.
function createMessageConsumer(websubhub:VerifiedSubscription message) returns kafka:Consumer|error {
string groupName = string `${message.hubTopic}_${message.hubCallback}`;
kafka:ConsumerConfiguration consumerConfiguration = {
groupId: groupName,
topics: [message.hubTopic],
// turn-off the auto offset commit
autoCommit: false
};
return check new ("localhost:9092", consumerConfiguration);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment