kumuluz / kumuluzee

Lightweight open-source framework for developing microservices using standard Java EE technologies and migrating Java EE to cloud-native architecture.
https://ee.kumuluz.com
MIT License
291 stars 71 forks source link

Activate or deactivate extensions via configuration file #106

Closed flavienlaurent closed 4 years ago

flavienlaurent commented 6 years ago

First, thanks for your work, Kumuluzee works great and is very promising!

I don't find a proper way to activate or deactivate extensions once there are in dependencies.

For example, I want to use consul as configuration provider in production environment but I would prefer to use a basic configuration file in dev environment. For now (and for test purpose), I'm hacking a bit via reflection the ConfigurationImpl in the ConfigurationUtil instance by removing the ConsulConfigurationSource from sources.

The same type of problem occurs for other extension like discovery. In production environment, I want to use consul but in dev environment, I would prefer to directly use entry points configured in configuration file. For now, I added a custom annotation with a custom producer. In dev environment, this producer procuces a WebTarget to entry points configured in the configuration file but in production environment, the "real" DiscoverServiceProducer is used to return a WebTarget .

A more elegant way seems to write my own EeApplication class which takes care of activation/deactivation via properties:

kumuluzee:
  extensions:
    config.enabled: false
    discovery.enabled: false
    fault.tolerance.enabled: false

but I'm afraid of side effects for some extensions.

Is there a better way to achieve this kind of activation/deactivation on extensions?

MBJuric commented 6 years ago

Hi, thanks for your feedback. We have received similar requests from other clients as well and will provide an official way to enable/disable extensions in the next version.

flavienlaurent commented 6 years ago

Great! Thanks for your response.

jmezna commented 4 years ago

Fixed in v3.0.0