Skip to content

MINIFICPP-1494 Allow InvokeHTTP GET requests without incoming flowfile#1082

Closed
lordgamez wants to merge 10 commits intoapache:mainfrom
lordgamez:MINIFICPP-1494
Closed

MINIFICPP-1494 Allow InvokeHTTP GET requests without incoming flowfile#1082
lordgamez wants to merge 10 commits intoapache:mainfrom
lordgamez:MINIFICPP-1494

Conversation

@lordgamez
Copy link
Contributor

Handling the use case when InvokeHTTP processor has no real incoming connection but there is a Retry self-loop, the scheduler should trigger the processor.

Jira ticket: https://issues.apache.org/jira/browse/MINIFICPP-1494

Note: We discussed that renaming the relationships is not an option to avoid introducing a breaking change, only change (1) is implemented


Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.

@lordgamez lordgamez marked this pull request as draft May 25, 2021 07:08
@lordgamez lordgamez marked this pull request as ready for review May 25, 2021 09:56
Comment on lines 77 to 82
: args_(args)
, configuration_(std::make_shared<minifi::Configure>())
, test_repo_(std::make_shared<TestRepository>())
, test_flow_repo_(std::make_shared<TestFlowRepository>())
, content_repo_(std::make_shared<core::repository::VolatileContentRepository>())
, stream_factory_(minifi::io::StreamFactory::getInstance(configuration_)) {
Copy link
Member

Choose a reason for hiding this comment

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

very minor, but I feel like the comma should be in the end of the previous lines, to comply with our style guide
https://google.github.io/styleguide/cppguide.html#Constructor_Initializer_Lists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, that was just some ad-hoc style I was used to. Fixed it in a0f1f41

HTTPIntegrationBase::setUrl(url, handler);
}

void setProperties(std::shared_ptr<core::Processor> proc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to increase the ref count of proc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 7f194ba

const auto components = flowController_->getComponents("InvokeHTTP");
assert(!components.empty());

const auto stateController = components.at(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This can even be accessed using [], since emptiness is checked before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 7f194ba

std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
content_repo->initialize(configuration);
std::shared_ptr<minifi::io::StreamFactory> stream_factory = minifi::io::StreamFactory::getInstance(configuration);
std::unique_ptr<core::FlowConfiguration> yaml_ptr = std::unique_ptr<core::YamlConfiguration>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be make_unique.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 7f194ba

@szaszm szaszm closed this in 31fd099 Jun 23, 2021
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.

6 participants