You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2018/09/21 15:55:46 UTC

[GitHub] nicolaferraro opened a new issue #115: Introducing Traits

nicolaferraro opened a new issue #115: Introducing Traits
URL: https://github.com/apache/camel-k/issues/115
 
 
   What is a trait?
   It's a high level "feature" of Camel K, but if I say "feature" you think to a completely different thing in the Camel/Karaf world, so let's call it "trait" for now.
   
   Some examples of traits I've in mind:
   - "dependencies": when activated, if you run a integration that uses a known component URI, the component is added to the classpath (already implemented, but it wasn't called a trait)
   - "expose": when activated, Camel K adds a service and a ingress to the deployment
   - "rest": when activated, Camel K adds and configure a rest environment (e.g. with netty-http or undertow) to expose rest endpoint
   - "openapi": adds openapi 2.0 libraries (Swagger) and configure them (this seems a Karaf feature). It also adds information on the apis on the deployment so that the apis can be discovered
   - "cron": converts a long-running timer into a Kubernetes cronJob, enabling the necessary configuration on the runtime
   - "knative-idler": binds the deployed integrations to knative, so that they can be scaled to 0 to save resources
   - "graal": compiles the integration with graal
   
   So traits are **complex features** that a user can **enable/disable**, or in some cases also **configure**. They're like "enrichers"/"generators" in the fabric8 maven plugin (for those who know it). But differently from f-m-p, we should document them.
   
   When a trait is not enabled/disabled by the user, Camel K tries to **determine the best configuration** of each trait for the application. E.g. the "rest" trait can be enabled automatically when I'm using rest in my integration, the "cron" trait can be enabled if I have a single route that starts with timer (and a configured long delay) and it needs to have a specific configuration so that the engine can trigger the integration correctly.
   
   Let's discuss about this.
   
   What do you think @lburgazzoli, @dmvolod, @oscerd, @valdar, @onderson?
   Is it a good abstraction over the features we've talked about in the dev mailing list?
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services