Skip to content

Conversation

@Yashwanth-Ranjan-Singaravel
Copy link
Contributor

No description provided.

@Yashwanth-Ranjan-Singaravel Yashwanth-Ranjan-Singaravel changed the title Feature/optimize kafka consumer Optimize kafka consumer by merging identical consumers Nov 12, 2025
@Yashwanth-Ranjan-Singaravel
Copy link
Contributor Author

Depends on the group removal pr at #362

copy(topics, trigger.Topics)
sort.Strings(topics)

// Create canonical key: brokers|topics|offset_reset
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to make it a TODO for now. But do we need to escape this? Could "|" be in the topic name?

// ComputeTriggerKey creates a deterministic key from trigger config
func ComputeTriggerKey(trigger *common.KafkaTrigger) TriggerKey {
// Sort brokers and topics for consistency
brokers := make([]string, len(trigger.BootstrapServers))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to make a TODO, but different functions could pick different bootstrap servers in the same Kafka cluster, so these would still be the same.

"lambda_count", len(lambdaNames))

// Invoke all lambdas in parallel
var wg sync.WaitGroup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not bother with a working group since we will batch soon

"total_lambdas", consumer.getLambdaCount())
} else {
// CREATE: New consumer needed
trigger.GroupId = string(triggerKey) // Use trigger key as group ID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily here, but we need some more general commenting about how we're multiplexing lambda-based consumer groups (that we create ourselves) on a single consumer group visible to Kafka.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants