mertdotcc commented on issue #4124: URL: https://github.com/apache/camel-k/issues/4124#issuecomment-1481354636
Hey @essobedo, I created two repositories, [issue4124part1](https://github.com/mertdotcc/issue4124part1) and [issue4124part2](https://github.com/mertdotcc/issue4124part2) Part 1 uses part 2 as a maven dependency. Part 2 is basically a basic mapping implementation using MapStruct. Notice that in the `pom.xml` of Part 2, we have the MapStruct plugin which basically creates the implementation class of the interface during `mvn install` process. I build and push the Part 2 package to the GitHub repo. Then Part 1 uses it basically. A couple of findings: This whole flow works perfectly when I deploy the part1 as a non-native image, using the following `kamel run` command: ``` kamel run \ --open-api file:./resources/part1-openapi.yaml \ --resource file:./resources/sample-error-response.json \ --dependency mvn:com.mertdotcc:issue4124part2:1.5 \ --dependency mvn:org.mapstruct:mapstruct:1.5.2.Final \ --dependency mvn:com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.2 \ --source ./sources/IntegrationBean.java \ --trait container.enabled=true \ --trait container.request-cpu="250m" \ --trait container.request-memory="256Mi" \ --trait container.limit-cpu="500m" \ --trait container.limit-memory="512Mi" \ --trait container.port=8443 \ --trait health.enabled=true \ --trait health.liveness-probe-enabled=true \ --trait health.liveness-scheme="HTTP" \ --trait health.liveness-initial-delay=0 \ --trait health.liveness-timeout=10 \ --trait health.liveness-period=15 \ --trait health.liveness-success-threshold=1 \ --trait health.liveness-failure-threshold=3 \ --trait health.readiness-probe-enabled=true \ --trait health.readiness-scheme="HTTP" \ --trait health.readiness-initial-delay=0 \ --trait health.readiness-timeout=10 \ --trait health.readiness-period=15 \ --trait health.readiness-success-threshold=1 \ --trait health.readiness-failure-threshold=3 \ Integration.java ``` But when I enable the native mode, it doesn't work. I use the following `kamel run` command to run my integration in native mode: ``` kamel run \ --open-api file:./resources/part1-openapi.yaml \ --resource file:./resources/sample-error-response.json \ --dependency mvn:com.mertdotcc:issue4124part2:1.5 \ --dependency mvn:org.mapstruct:mapstruct:1.5.2.Final \ --dependency mvn:com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.2 \ --source ./sources/IntegrationBean.java \ --trait container.enabled=true \ --trait container.request-cpu="250m" \ --trait container.request-memory="256Mi" \ --trait container.limit-cpu="500m" \ --trait container.limit-memory="512Mi" \ --trait container.port=8443 \ --trait health.enabled=true \ --trait health.liveness-probe-enabled=true \ --trait health.liveness-scheme="HTTP" \ --trait health.liveness-initial-delay=0 \ --trait health.liveness-timeout=10 \ --trait health.liveness-period=15 \ --trait health.liveness-success-threshold=1 \ --trait health.liveness-failure-threshold=3 \ --trait health.readiness-probe-enabled=true \ --trait health.readiness-scheme="HTTP" \ --trait health.readiness-initial-delay=0 \ --trait health.readiness-timeout=10 \ --trait health.readiness-period=15 \ --trait health.readiness-success-threshold=1 \ --trait health.readiness-failure-threshold=3 \ --trait quarkus.enabled=true \ --trait quarkus.package-type=native \ Integration.java ``` Please pull the repo for `part1` and check the local history of `Integration.java` line 24. Basically; Using `.to("bean:IntegrationBean?method=handleMapping")` in non-native mode works fine, in native mode, it compiles and the pod starts but when I send a request, I get the `method not found` exception. Using `.bean("IntegrationBean", "handleMapping")` in non-native works, but in native it doesn't work. The pod doesn't even start. I get `CrashLoopBackOff`. Using ``` .process(exchange -> { IntegrationBean bean = (IntegrationBean) this.getCamelContext().getRegistry().lookupByName("IntegrationBean"); bean.handleMapping(exchange); }) ``` also doesn't work in native. Same problem: `CrashLoopBackOff`. I basically need at least one approach that works in native mode as this is critical for our operation. I am open to any suggestions and would be happy to provide more info/details. Many thanks in advance. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
