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

[test] add Kamelet errorHandler test #2522

Merged
merged 1 commit into from
Sep 20, 2021
Merged

Conversation

bouskaJ
Copy link
Contributor

@bouskaJ bouskaJ commented Jul 23, 2021

Release Note

NONE

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a very good PR that includes the Kamelet creation support! There are a few changes that would make it more reusable, feel free to follow those suggestions and if you have any further doubt I will be happy to help.

e2e/support/test_support.go Outdated Show resolved Hide resolved
e2e/support/test_support.go Outdated Show resolved Hide resolved
e2e/support/test_support.go Outdated Show resolved Hide resolved
@bouskaJ bouskaJ force-pushed the errorHandler branch 3 times, most recently from b9a4721 to 2df7788 Compare July 23, 2021 11:02
@bouskaJ
Copy link
Contributor Author

bouskaJ commented Jul 23, 2021

@squakez, @astefanutti the CI fails with

 logs:
Error:     dump.go:142:     integration
Error:     dump.go:174:     > 	at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:236)
Error:     dump.go:174:     > 	... 31 more
Error:     dump.go:174:     > 
Error:     dump.go:174:     > 2021-07-23 11:25:32,186 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): org.apache.camel.NoSuchBeanException: No bean could be found in the registry for:  defaultErrorHandler of type: org.apache.camel.ErrorHandlerFactory
Error:     dump.go:174:     > 	at org.apache.camel.support.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:241)
Error:     dump.go:174:     > 	at org.apache.camel.model.errorhandler.ErrorHandlerHelper.lookupErrorHandlerFactory(ErrorHandlerHelper.java:82)
Error:     dump.go:174:     > 	at org.apache.camel.reifier.errorhandler.ErrorHandlerRefReifier.lookupErrorHandler(ErrorHandlerRefReifier.java:41)
Error:     dump.go:174:     > 	at org.apache.camel.reifier.errorhandler.ErrorHandlerRefReifier.createErrorHandler(ErrorHandlerRefReifier.java:35)

the generated KameletBinding is

spec:
  errorHandler:
    dead-letter-channel:
      endpoint:
        properties:
          loggerName: kameletErrorHandler
        ref:
          apiVersion: camel.apache.org/v1alpha1
          kind: Kamelet
          name: my-own-log-sink
  sink:
    properties:
      loggerName: integrationLogger
    ref:
      apiVersion: camel.apache.org/v1alpha1
      kind: Kamelet
      name: my-own-log-sink
  source:
    properties:
      message: throw Error
    ref:
      apiVersion: camel.apache.org/v1alpha1
      kind: Kamelet
      name: my-own-error-producer-source
   spec:
          configuration:
          - type: property
            value: 'camel.beans.defaultErrorHandler = #class:org.apache.camel.builder.DeadLetterChannelBuilder'
          - type: property
            value: camel.beans.defaultErrorHandler.deadLetterUri = kamelet:my-own-log-sink/errorHandler
          - type: property
            value: camel.k.errorHandler.ref = defaultErrorHandler
          - type: property
            value: camel.kamelet.my-own-error-producer-source.source.message = throw Error
          - type: property
            value: camel.kamelet.my-own-log-sink.errorHandler.loggerName = kameletErrorHandler
          - type: property
            value: camel.kamelet.my-own-log-sink.sink.loggerName = integrationLogger
          flows:
          - from:
              steps:
              - to: kamelet:my-own-log-sink/sink
              uri: kamelet:my-own-error-producer-source/source
          profile: OpenShift

The most important message is that the test is working on 1.4.0. Do you know what could be wrong?

@squakez
Copy link
Contributor

squakez commented Jul 23, 2021

Yeah, I bumped into that issue as well while working on something different. I am investigating and will report more details shortly.

@squakez
Copy link
Contributor

squakez commented Jul 23, 2021

Tracked here #2525

@squakez
Copy link
Contributor

squakez commented Aug 10, 2021

Let's wait to merge #2564 and we can rebase this.

@mcada
Copy link

mcada commented Aug 24, 2021

#2564 is merged - can we proceed with the rebase?

@squakez
Copy link
Contributor

squakez commented Aug 24, 2021

#2564 is merged - can we proceed with the rebase?

Yes please.

@bouskaJ bouskaJ force-pushed the errorHandler branch 2 times, most recently from 6b0b2c3 to 25318e7 Compare August 25, 2021 10:15
@bouskaJ
Copy link
Contributor Author

bouskaJ commented Aug 25, 2021

@squakez Two CI workflows failed but it seems that it's not my fault. Can you rerun them?

Ref: &to,
Properties: asEndpointProperties(sinkProperties),
},
ErrorHandler: asErrorHandlerSpec(errorHandler),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one should be optional. If you provide some meaningful configuration, then you can provide the ErrorHandler parameter, otherwise you must not. The error reported in the CI may be because of this configuration that likely is set to empty.

@squakez squakez merged commit ee8a11e into apache:main Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants