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-11614 Improve Validation for JndiJmsConnectionFactoryProvider #7313

Closed
wants to merge 4 commits into from

Conversation

exceptionfactory
Copy link
Contributor

Summary

NIFI-11614 Improves property validation for the JndiJmsConnectionFactoryProvider Controller Service with a set of allowed URL schemes and disallowed Context Factory classes.

The current implementation only checks for a configured value with standard properties, but the new validation narrows the scope to provide better validation prior to enabling the provider.

The initial set of allowed URL schemes is based on the ActiveMQ Using JMS documentation. The new URL validation narrows the scope of potential values, which should be noted in migration guidance, providing a clearer set of supported values

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

Please indicate the verification steps performed prior to pull request creation.

Build

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

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

@turcsanyip turcsanyip self-requested a review May 31, 2023 11:55
@turcsanyip
Copy link
Contributor

Will review...

Copy link
Contributor

@turcsanyip turcsanyip left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @exceptionfactory! The approach of customization via system properties looks good.

I added a few improvement comments. The most important one is the single vs. multiple disallowed context factories. Pls. see them below.

@exceptionfactory
Copy link
Contributor Author

Thanks for the additional feedback @turcsanyip!

On further consideration, the URL Scheme validation seems sufficient, so I removed the Context Factory class validation and associated documentation. I also adjusted the System property evaluation approach so that the unit tests could evaluate both scenarios.

Copy link
Contributor

@turcsanyip turcsanyip left a comment

Choose a reason for hiding this comment

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

Thanks @exceptionfactory!

+1 LGTM
Merging to main and support/1.x.

@asfgit asfgit closed this in b042eb0 Jun 1, 2023
asfgit pushed a commit that referenced this pull request Jun 1, 2023
This closes #7313.

Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
@schnells
Copy link

Thanks for implementing a validator. Because these are very useful.

Unfortunately, this currently prevents the use of salace and nifi. the solace messaging protocol (SMF) uses a url format like smfs://<solace>:<port>

Unfortunately the validator fails with smfs urls. Is it possible to include smfs in the validator list?
I would also open the necessary pull request. Because currently we cannot use nifi 1.22 in combination with solace.

@exceptionfactory
Copy link
Contributor Author

Thanks for the feedback @schnells. As this pull request is closed, it would be helpful to create an Apache NiFi Jira issue for further discussion.

Adding smfs to the default list sounds like a reasonable improvement.

As an alternative for now, the Provider supports a Java System property that can be used to set the allowed URLs.

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-jms-processors-nar/1.22.0/org.apache.nifi.jms.cf.JndiJmsConnectionFactoryProvider/additionalDetails.html

In this scenario, the following line can be added to bootstrap.conf to allow smfs:

java.arg.jndiJmsUrlSchemesAllowed=-Dorg.apache.nifi.jms.cf.jndi.provider.url.schemes.allowed=smfs

@schnells
Copy link

Thanks @exceptionfactory for the quick response! I will absolutely have a look into the java system property.
I will create a Jira issue in the near future.

udaynpusa pushed a commit to mapr/nifi that referenced this pull request Apr 25, 2024
This closes apache#7313.

Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
(cherry picked from commit b042eb0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants