Skip to content

kafka: add stub classes for mesh filter#17374

Merged
mattklein123 merged 2 commits intoenvoyproxy:mainfrom
adamkotwasinski:filter-stub
Jul 22, 2021
Merged

kafka: add stub classes for mesh filter#17374
mattklein123 merged 2 commits intoenvoyproxy:mainfrom
adamkotwasinski:filter-stub

Conversation

@adamkotwasinski
Copy link
Contributor

@adamkotwasinski adamkotwasinski commented Jul 15, 2021

Commit Message: kafka: add stub classes for mesh filter
Additional Description: stub for Kafka mesh filter
creates a new filter object, abstraction for in-flight request, very simple request processor (that doesn't process any of requests); provides generic logic of how the mesh will work on a high level:

  • receive the kafka request
  • run it thru decoder (this is existing code from broker-filter)
  • run decoded message thru processor to enrich it into actionable object
  • processor brings it back to filter to store it and start processing
  • (not in this PR) depending on request type, we engage upstream brokers (we finally send records) or are ready immediately
  • (not in this PR) request notifies owner (filter) that it's finished and owner (filter) can finally respond on connection

Risk Level: low, code cannot be referenced as it doesn't have an extension
Testing: unit tests right now
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #17374 was opened by adamkotwasinski.

see: more, trace.

@adamkotwasinski
Copy link
Contributor Author

Let's run builds for now, most probably something will be red and I'll notice some more places to add comments.

Signed-off-by: Adam Kotwasinski <adam.kotwasinski@gmail.com>
* Represents single downstream client request.
* Responsible for performing the work on multiple upstream clusters and aggregating the results.
*/
class InFlightRequest {
Copy link
Contributor Author

@adamkotwasinski adamkotwasinski Jul 19, 2021

Choose a reason for hiding this comment

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

Implementations of this interface will provide the proper handling to provide kafka-mesh features.
To have basic compliance with protocol we will require to handle the following types (these are links to stuff that will appear in "future PRs"):


void RequestProcessor::onMessage(AbstractRequestSharedPtr arg) {
// This will be replaced with switch on header's API key.
throwOnUnsupportedRequest("unsupported (bad client API invoked?)", arg->request_header_);
Copy link
Contributor Author

@adamkotwasinski adamkotwasinski Jul 19, 2021

Choose a reason for hiding this comment

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

When arg can be actually turned into instance of InFlightRequest then we can go back to filter.

Rough impl (needs some merging): link

Signed-off-by: Adam Kotwasinski <adam.kotwasinski@gmail.com>
@adamkotwasinski adamkotwasinski marked this pull request as ready for review July 19, 2021 22:57
@adamkotwasinski adamkotwasinski changed the title kafka: add a filter stub for mesh filter kafka: add stub classes for mesh filter Jul 19, 2021
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks. Since this extension is going to get moved to contrib I quickly skimmed and am going to merge.

@mattklein123 mattklein123 merged commit 6c25d07 into envoyproxy:main Jul 22, 2021
@adamkotwasinski adamkotwasinski deleted the filter-stub branch July 22, 2021 19:32
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
Signed-off-by: Adam Kotwasinski <adam.kotwasinski@gmail.com>
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.

2 participants