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

kamelet-binding : suport for error handling #1941

Closed
lburgazzoli opened this issue Jan 22, 2021 · 4 comments · Fixed by #2217
Closed

kamelet-binding : suport for error handling #1941

lburgazzoli opened this issue Jan 22, 2021 · 4 comments · Fixed by #2217
Assignees
Milestone

Comments

@lburgazzoli
Copy link
Contributor

lburgazzoli commented Jan 22, 2021

We should support setting-up an error handler, like:

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: telegram-text-source-to-kafka
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: telegram-text-source
    properties:
      botToken: the-token-here
  sink:
    ref: 
      kind: KafkaTopic
      apiVersion: kafka.strimzi.io/v1beta1
      name: my-topic
  error-handler: 
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: retry-handler
    properties:
      ...    
@lburgazzoli
Copy link
Contributor Author

/cc @nicolaferraro

@nicolaferraro nicolaferraro added this to the 1.4.0 milestone Feb 9, 2021
@squakez
Copy link
Contributor

squakez commented Mar 15, 2021

I am having a look at it

@heiko-braun
Copy link

heiko-braun commented Mar 17, 2021

Is there wat to distinguish types of errors that might trigger an error handler in the first place?
Thinking about something like this:

  • Failure: External behavior is incorrect
  • Fault: Discrepancy in code that causes a failure.
  • Error: Human mistake that caused fault

Some examples that come to my mind to further illustrate this:

  • Failure: Cannot connect to thirdparty system (i.e. transport level)
  • Fault: Exception raised within the Camel DSL execution (i.e. syntax error)
  • Error: Wrong credentials lead to authentication exceptions

If we could tell the difference between types of errors, we could supply more tailored error handling strategies (i.e. multiple error handlers)

Food for thought.

@squakez
Copy link
Contributor

squakez commented Mar 18, 2021

Not sure about the underlying details of Camel, but we may think of giving the user the possibility to chose what to do based on the specific exception caught. Maybe the same try-catch could work out of the box if used in the steps. However I think it defeats the concept of hiding the complexity behind the scene as the user must know the java exception type that may be thrown. We may consider come back to this as advanced feature in a future refinement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants