MINIFICPP-2797 Extend C Api with sslcontext, penalize, dynamic properties, flowfile id and size#2166
MINIFICPP-2797 Extend C Api with sslcontext, penalize, dynamic properties, flowfile id and size#2166martinzink wants to merge 5 commits intoapache:mainfrom
Conversation
67568b6 to
61f301a
Compare
There was a problem hiding this comment.
Pull request overview
Extends the MiNiFi C extension API to expose additional ProcessSession/ProcessContext capabilities needed by external extensions (e.g., Kafka migration), including penalization, FlowFile metadata access, dynamic properties enumeration, and SSLContextService data access.
Changes:
- Adds new exported C API functions (penalize, flowfile id/size, dynamic properties, SSL data) and renames FlowFile attribute functions under
MinifiProcessSession*. - Implements the new API surface in
libminifi/src/minifi-c.cpp. - Updates the C++ extension wrapper (
cpp-extension-lib) to call the renamed attribute APIs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| minifi-api/minifi-c-api.def | Updates Windows export list with new/renamed C API symbols. |
| minifi-api/include/minifi-c/minifi-c.h | Adds new C API declarations/constants and SSL data struct/callback. |
| libminifi/src/minifi-c.cpp | Implements new C API functions for penalize, flowfile metadata, dynamic properties, and SSL data. |
| extension-framework/cpp-extension-lib/src/core/ProcessSession.cpp | Migrates wrapper to renamed attribute APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
61f301a to
430e4c1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ties, flowfile id and size #2166
| const std::string ca_cert_file = ssl_context_service->getCACertificate().string(); | ||
| const std::string passphrase = ssl_context_service->getPassphrase(); | ||
| const std::string cert_file = ssl_context_service->getCertificateFile().string(); | ||
| const std::string private_key_file = ssl_context_service->getPrivateKeyFile().string(); |
There was a problem hiding this comment.
We need to handle exceptions here, so that no C++ exceptions cross the C API boundary. And ideally we should handle string allocation errors too.
| #define MINIFI_REGISTER_EXTENSION_FN MinifiRegisterExtension | ||
| #endif | ||
|
|
||
| /// To allow the proper usage of SSLContextServices set the MinifiPropertyDefinition::type to MINIFI_SSL_CONTEXT_SERVICE_PROPERTY_TYPE |
There was a problem hiding this comment.
This doesn't really describe what proper usage means, so I would rephrase it to something like: "To declare a processor property that expects an SSLContextService, use MINIFI_SSL_CONTEXT_SERVICE_PROPERTY_TYPE in the type field of the property definition (MinifiPropertyDefinition::type)"
| void* user_ctx); | ||
|
|
||
| typedef struct MinifiSslData { | ||
| uint8_t version; |
There was a problem hiding this comment.
I'm thinking we can probably do without this version field, and just rely on the extension API version in case the layout ever changes.
MINIFICPP-2797
There are a couple functions missing from the stable API that prevents us to migrate Kafka,
namely penalize, sslcontext functionality, dynamic property handling, flowfile id and flowfile size
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:
For documentation related changes:
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.