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

How to extend validation options for "Reactive Messaging for MicroProfile" connector ? #439

Open
scottkurz opened this issue Mar 12, 2024 · 8 comments

Comments

@scottkurz
Copy link

In OpenLiberty/liberty-tools-eclipse#500, we see an issue validating an MP config property:
mp.messaging.outgoing.systemLoad.connector=liberty-kafka

with description:
Invalid enum value: 'liberty-kafka' is invalid for type org.eclipse.microprofile.reactive.messaging.spi.Connector

This is LSP4MP version 0.10.0.

Would you envision adding a new option here to the core LSP4MP? An extension (or as part of the "client" pulling in LSP4MP) ?

Figured I'd just ask and see your first response before thinking too hard myself. Thank you.

@fbricon
Copy link
Contributor

fbricon commented Mar 12, 2024

please attach a sample project reproducing the issue.

I can't tell at this point if this requires extending lsp4mp or if relaxing lsp4mp validation is a better approach. @angelozerr?

@scottkurz
Copy link
Author

Thanks. To recreate:

  1. Install Eclipse for Java package: 2023-12
  2. Install Liberty Tools Eclipse 23.0.12 (latest currently in Eclipse Marketplace https://marketplace.eclipse.org/content/liberty-tools)
  3. git clone [email protected]:openliberty/guide-microprofile-reactive-messaging.git
  4. Do a mvn import guide-microprofile-reactive-messaging/finish and child projects into Eclipse
  5. Open system/src/main/resources/META-INF/microprofile-config.properties

@angelozerr
Copy link
Contributor

I can't tell at this point if this requires extending lsp4mp or if relaxing lsp4mp validation is a better approach. @angelozerr?

I dont remember how this validation is working. I need to find time to understand again how it works.

@angelozerr
Copy link
Contributor

@scottkurz the liberty-kafka should be retrieved from https://github.com/OpenLiberty/open-liberty/blob/912749d6fee4cc44047d0841dda9897f5c2837df/dev/com.ibm.ws.microprofile.reactive.messaging.kafka/src/com/ibm/ws/microprofile/reactive/messaging/kafka/KafkaOutgoingConnector.java#L44

I have imported your project and KafkaOutgoingConnector is not in the classpath, perhaps it misses a dependency in your pom.xml?

@scottkurz
Copy link
Author

Thank you @angelozerr for explaining that. I see what you're saying. This is just a String in a properties file, so it's not required to compile or at runtime... but the validation needs to see it on the classpath to validate it.

I still wonder if maybe the validation is too strict or needs to be adjusted, but I'm not arguing that yet. Let me first see what the pom.xml would look like. Thanks

@angelozerr
Copy link
Contributor

angelozerr commented Jul 12, 2024

If you start the project is it working?

I dont understand how it can work if it misses the liberty kafka connector on the classpath

@scottkurz
Copy link
Author

I dont understand how it can work if it misses the liberty kafka connector on the classpath

Within Liberty there's a different classloader structure than the one built by Maven.

@angelozerr
Copy link
Contributor

To fix your issue, your liberty tooling will need to add an extension to add this missing properties like we did with Quarkus LS JDT extension https://github.com/redhat-developer/quarkus-ls/tree/master/quarkus.jdt.ext which add Quarkus deploiement in classpath when properties are collected (see https://github.com/search?q=repo%3Aredhat-developer%2Fquarkus-ls%20deployment&type=code)

Your extension could:

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

No branches or pull requests

3 participants