apache / camel-kamelets

Apache Camel Kamelets Repository
https://camel.apache.org
Apache License 2.0
55 stars 79 forks source link

Replace to use org.messaginghub:pooled-jms in JMS Pooled Kamelet #2174

Closed zhfeng closed 2 months ago

zhfeng commented 2 months ago

Well io.quarkiverse.messaginghub:quarkus-pooled-jms is a extension for quarkus but here in this kamelet I think only org.messaginghub:pooled-jms is needed for pooledFactoryBean.

oscerd commented 2 months ago

I don't remember the reason but please test the update through camel-jbang

zhfeng commented 2 months ago

Hmm, can you provide the command I need to test by camel-jbang?

oscerd commented 2 months ago

I meant to say if you can test the kamelet with camel-jbang or what you're using

zhfeng commented 2 months ago

Yeah, I run a jbang example from https://github.com/apache/camel-kamelets-examples/tree/main/jbang/timer-activemq-artemis. But how to use the 4.8.0-SNAPSHOT of org.apache.camel.kamelets:camel-kamelet ?

jbang -Dcamel.jbang.version=4.8.0-SNAPSHOT camel@apache/camel run artemis-log.camel.yaml --kamelets-version=4.8.0-SNAPSHOT

[jbang] [WARN] Detected missing or out-of-date dependencies in cache.
[jbang] Resolving dependencies...
[jbang]    org.apache.camel:camel-bom:4.8.0-SNAPSHOT@pom
[jbang]    org.apache.camel:camel-jbang-core:4.8.0-SNAPSHOT
[jbang]    org.apache.camel.kamelets:camel-kamelets:4.7.0
[jbang] Dependencies resolved
...

@davsclaus @oscerd it's still 4.7.0 even I add --kamelets-version=4.8.0-SNAPSHOT. any hint?

davsclaus commented 2 months ago

kamelets JAR is loaded by jbang, so you cannot use --kamelets-version. Use -Dcamel-kamelets.version=xxx or better just edit the .java file in your ~/.jbang cache folder

zhfeng commented 2 months ago

Thanks a lot @davsclaus - Now I can run the example perfectly with the jbang -Dcamel-kamelets.version=4.8.0-SNAPSHOT

oscerd commented 2 months ago

You can also use --local-kamelet-dir param

zhfeng commented 2 months ago

Thanks @oscerd - yeah, it works with --local-kamelet-dir as well.

zhfeng commented 2 months ago

Just curious, is it possible to use different artifacts based on runtime in kamelet?

I'm asking because if we run this kamelt in a quarkus runtime, by adding quarkus-pooled-jms and quarkua-artemis, there is also no need to create a pooledFactoryBean.

oscerd commented 2 months ago

No, it's not possible, but you can create your own Kamelet and use that directly. The aim of Kamelets is creating a building block to make possible for end-users to create their own catalog.

zhfeng commented 2 months ago

Hmm, get it. Is there any label can be used to mark it only used in a specific runtime?