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

NIFI-13543 Add HttpRecordSink #9185

Closed
wants to merge 2 commits into from

Conversation

jrsteinebrey
Copy link
Contributor

@jrsteinebrey jrsteinebrey commented Aug 19, 2024

Summary

NIFI-13543

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Automated unit test were written and executed successfully.
The HttpRecordSink was tested from the NiFi ui and worked as intended.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

.name("Maximum Batch Size")
.description("Specifies the maximum number of records to send in the body of each HTTP request. Zero means the batch size is not limited, "
+ "and all records are sent together in a single HTTP request.")
.defaultValue("1")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the default should be zero, it can be set to 1 for users of Kafka for example, but since you get a whole record set at once via the API, we should default to send them all. This mimics the behavior of InvokeHttp. @exceptionfactory had some comments on the processor version of this in #8127 and its predecessors for the processor version of this. For this use case it's good as a RecordSink especially for QueryNiFiReportingTask.

return writeResult;
}

public void sendHttpRequest(final byte[] body, String mimeType) { // throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this throw the IOException to get caught "upstream"? If not this comment can be removed

@jrsteinebrey jrsteinebrey requested a review from mattyb149 August 21, 2024 21:52
@mattyb149
Copy link
Contributor

+1 LGTM, verified the changes and the behavior is as expected. Thanks for the new feature! Merging to main

@mattyb149 mattyb149 closed this in cbdc53a Aug 23, 2024
@jrsteinebrey jrsteinebrey deleted the NIFI-13543-B branch September 9, 2024 19:16
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