camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

Run without source code

Open ammachado opened this issue 3 years ago • 6 comments

Is it possible to run integrations contained in a JAR file, without having to specify which source files will be used? Or pull a Maven dependency and run every route on it?

ammachado avatar May 23 '22 21:05 ammachado

I think a better implementation what I was talking about is in #334

ammachado avatar May 23 '22 23:05 ammachado

There are several ways to use custom dependencies. Pre 1.9 you can use Jitpack dependencies (https://camel.apache.org/camel-k/1.9.x/configuration/dependencies.html#dependencies-kind-jitpack). In 1.9 release you can use directly the -d option passing your dependency, such as:

kamel run MyIntegration.java -d file://path/to/my-integration.jar

Have a look to the blog post for some more detail: https://camel.apache.org/blog/2022/04/camel-k-release-1-9/

squakez avatar May 24 '22 08:05 squakez

In your example you still must have a MyIntegration.java integration file.

Let's suppose that all my routes are packaged a few JAR files and pushed to a Maven repository. For example, I have a common-routes JAR with shared routes and another JAR files with the routes itself, customer-route-package, which depends on common-routes.

What I'm trying to accomplish is something like:

kamel run mvn:my.org:customer-route-package:1.0 -d mvn:my.org:common-routes:1.0

It will even better if somehow the dependencies could be automatically pulled, like they would if the route-package artifact was used as a dependency in another project.

ammachado avatar May 24 '22 12:05 ammachado

camel k is powered on top of camel-main, and it has a ton of options for route discovery. But it may be that the camel-k-operator is hardcoding some of these options so you can't tweak it

See the option camel.main.routesInclude​Pattern https://camel.apache.org/components/3.17.x/others/main.html

Where you can configure it with classpath:xxx to do classpath scanning.

davsclaus avatar May 24 '22 13:05 davsclaus

Ah, okey, I got it now. That is not possible at the moment. Maybe you can play a bit with the jvm trait and use the options to tune the resulting java execution command, but the presence of a source appears to be required at the moment.

squakez avatar May 24 '22 13:05 squakez

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] avatar Aug 23 '22 00:08 github-actions[bot]

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] avatar Nov 22 '22 00:11 github-actions[bot]