Skip to content
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

KREST-10313 Prototype of batch REST Produce #1162

Merged
merged 3 commits into from May 24, 2023
Merged

Conversation

AndrewJSchofield
Copy link
Member

An alternative to streaming REST Produce based on an array of requests and responses.

@AndrewJSchofield AndrewJSchofield requested a review from a team as a code owner May 15, 2023 12:42
@AndrewJSchofield AndrewJSchofield marked this pull request as draft May 15, 2023 12:42
@AndrewJSchofield AndrewJSchofield marked this pull request as ready for review May 22, 2023 10:10
api/v3/openapi.yaml Show resolved Hide resolved
@@ -2330,6 +2424,44 @@ components:
nullable: true
nullable: true

ProduceBatchRequest:
Copy link
Member

@msn-tldr msn-tldr May 23, 2023

Choose a reason for hiding this comment

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

Do run it through various open-api linters.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will do when I'm ready.

api/v3/openapi.yaml Show resolved Hide resolved
api/v3/openapi.yaml Outdated Show resolved Hide resolved
api/v3/openapi.yaml Outdated Show resolved Hide resolved
ProduceBatchResponse:
description: |-
The response containing a delivery report for each record produced to a topic.
A separate delivery report will be returned, in the same order, each with its own error_code.
Copy link
Member

@msn-tldr msn-tldr May 23, 2023

Choose a reason for hiding this comment

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

nit: I think it should mention a high level list of "error_codes" to expect in a delivery report.

executorService);
}

private CompletableFuture<ProduceBatchResultEntry> produce(
Copy link
Member

@msn-tldr msn-tldr May 23, 2023

Choose a reason for hiding this comment

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

Is there a way to better organize this code? 🤔
with 2 ProduceAction*.java files, any future modifications like to rate-limiting, billing would have to be in 2 places, not ideal.
Maybe divide the logic into 2 bits -

  1. "internal-facing-logic" - this will the common produce bits, like "actual produce", rate-limiting, billing etc.
  2. "external-facing" Produce*Action.java that validations, ser & deser for external data-strucutures.

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is probably ripe for refactoring when it's settled down a bit.

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class ProduceBatchActionTest {
Copy link
Member

Choose a reason for hiding this comment

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

Very thorough UTs, nice!

Copy link
Member

@msn-tldr msn-tldr left a comment

Choose a reason for hiding this comment

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

Other than few open comments, I think its lgtm to merge, so approving.

@AndrewJSchofield AndrewJSchofield merged commit 647f297 into master May 24, 2023
3 checks passed
@AndrewJSchofield AndrewJSchofield deleted the KREST-10313 branch May 24, 2023 10:08
Copy link
Member

@trnguyencflt trnguyencflt left a comment

Choose a reason for hiding this comment

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

LGTM

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.

None yet

3 participants