-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support partition consumer mode for kafka channel #879
support partition consumer mode for kafka channel #879
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
/ok-to-test |
28b05a0
to
add9b4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice bit of work!
The following is the coverage report on pkg/.
|
/lgtm nice idea. Perhaps we should change this to be the default behavior, in the future |
} else { | ||
break | ||
if cluster.ConsumerModePartitions == d.kafkaCluster.GetConsumerMode() { | ||
go d.partitionConsumerLoop(consumer, channelRef, sub) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot, this looks easier to test now.
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuzisun Thanks, and thanks for writing unit tests! Did you verify this feature works in a real cluster? I'm not very familiar with the Kafka channel and there aren't any E2E tests yet, so I'd like to hear from at least one person who's seen this code work in real life 😀
Also, since this adds a feature to the Kafka channel config map, can you write a blurb about it in the Release Note block? Seems like it can be copied from your Proposed Changes list.
istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" | ||
"go.uber.org/zap" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp" | ||
"os" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you run gofmt
on this file? I'd have expected it to put this import above next to flag
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I did run gofmt -w main.go
, nothing changes, then I purposely put next to flag
and rerun gofmt
it puts os
back after _ k8s.io/client-go/plugin/pkg/client/auth/gcp
, looks weird. I am using go version go1.11.5 darwin/amd64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird! I don't know why it does that, but I guess it's correct by definition. So 👍
Added the release note. I did verify this in the real cluster and I can also look into adding a E2E test for kafka. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the release note. I did verify this in the real cluster and I can also look into adding a E2E test for kafka.
Thanks! I took the liberty of moving the release note text into the ```releasenote
block. E2E tests can be another PR.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: grantr, yuzisun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
* support partition consumer for kafka channel * consolidate GetProvisionerConfig function * add consumer mode config test * address review comments
Fixes #693
Proposed Changes
consumer_mode
in kafka channel config, by default it is still doing multiplexing. Whenconsumer_mode
is set topartitions
, kafka dispatcher should start creating partition consumer for the channels and events are dispatched on different go channels for different partitions.Release Note