Coder Social home page Coder Social logo

Comments (6)

decebals avatar decebals commented on May 20, 2024

I don't have an answer to your problem but I'm curios to see if anyone faced a similar request and if they solved the problem.
In the same SaaS context I have a request for a plug-able features, each feature comes with a contribution for database layer (create new tables, alter existed tables, .. - using flyway or liquibase), service layer and so on. Things seem relatively simple until this SaaS intervenes (multi tenant, ..).

from pf4j.

jingsewu avatar jingsewu commented on May 20, 2024

Indeed, in my current design, I've integrated multi-tenancy and established a table that tracks each tenant's installed plugins along with their respective statuses, whether they're marked as "STARTED" or "STOPPED."

However, the challenge arises when dealing with plugins that possess multiple versions yet belong to the same package.

Your insights on this matter would be greatly appreciated.

from pf4j.

decebals avatar decebals commented on May 20, 2024

To make a summary, if I understood correctly you have an application (SaaS platform) with a bunch of plugins, there is the possibility that one or more plugins come in several versions.
You have a store (database table) where you keep some metadata related to what plugins (plugin <-> version pair) uses each tenant (customer) and the status of these plugins for that tenant (started, stopped, ..).
The idea is that your application uses the same logic (code base) for all tenants -> your application loads and starts a bunch of plugins for all tenants. If your plugins come with extensions => you use getExtensions(Class<T> type, String pluginId) method instead of getExtensions(Class<T> type) method because you need to check if a plugin is "visible" for a tenant.
Is what I say correct, can you add additional information?

from pf4j.

jingsewu avatar jingsewu commented on May 20, 2024

Yes. But I am now using pf4j-spring to manage these plugins. So if Saas platform has different versions of plugins. Suppose different versions of plugins have the same package name and class name, in that case it will report an error. Because the same bean cannot exist in the same spring container.
Do I need to set up different spring containers for different versions of the plugin? Or do I need to specify that different versions of the plugin cannot have the same package name? Or is there another better solution here.

from pf4j.

decebals avatar decebals commented on May 20, 2024

Maybe the best place for a such question is pf4j-spring, because the problem is related to the integration of pf4j in a spring application.

Suppose different versions of plugins have the same package name and class name, in that case it will report an error. Because the same bean cannot exist in the same spring container.

An idea is to create a different spring ApplicationContext (in SpringPlugin) for each plugin version when you have multiple versions.

from pf4j.

jingsewu avatar jingsewu commented on May 20, 2024

Thank you for your reply. Maybe it is a good idea to create a different spring ApplicationContext (in SpringPlugin) for each plugin version. I will close this issure and search more ideas form pf4j-spring.

from pf4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.