You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/22 07:09:26 UTC

[GitHub] [camel-k] lburgazzoli commented on pull request #2217: feat(kamelets): kamelet binding error handler

lburgazzoli commented on pull request #2217:
URL: https://github.com/apache/camel-k/pull/2217#issuecomment-824598041


   Wondering if that is the right UX, i.e. not very easy to be described by a JSON Schema because there's no correlation between `type` and the other elements. 
   
   As example, you could write something like:
   
   ```yaml
   errorHandler:
       type: no
       endpoint:
         ref:
           kind: Kamelet
           apiVersion: camel.apache.org/v1alpha1
           name: error-handler
         properties:
           message: "ERROR!"
       configuration:
         maximumRedeliveries: 3
         redeliveryDelay: 2000
   ```
   
   Which would be quire misleading so I wonder if instead of having the `type` as discriminator we should have a top level element, like:
   
   ```yaml
   errorHandler:
       dead-letter:
         endpoint:
           ...
         parameters:
           ...
   ```
   
   Valid values for the top level field could be:
   - dead-letter
   - log (aka default but - IMHO - it is better being explicit)
   - none
   - builder|ref (this is to let the user pick any custom error handler provided by an `ErrorHandlerBuilder` bena)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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