Open davsclaus opened 5 months ago
@davsclaus How about if ActiveMQConnectionFactory
is wrapped by such JMSPoolConnectionFactory
provided by quarkus-pooled-jms
?
@davsclaus How about if
ActiveMQConnectionFactory
is wrapped by suchJMSPoolConnectionFactory
provided byquarkus-pooled-jms
?
We should not use runtime specific dependency where possible.
OK, so for camel-jms
we could only add jakarta.jms.ConnectionFactory
to the reflection configuration in native mode. And for camel-sql
adding javax.sql.DataSource
?
Then if using with quarkus-pooled-jms
, there might be an issue to get brokerUrl
?
Ah, maybe we can consider to add ActiveMQConnectionFactory
reflection configuration in quarkus-artemis
extension?
Ah, maybe we can consider to add
ActiveMQConnectionFactory
reflection configuration inquarkus-artemis
extension?
Can we not just use Jandex and discover all impls of ConnectionFactory
& DataSource
?
@jamesnetherton well, it looks like quarkus-artemis-jms
has not included jandex yet.
I don't think this can work OOTB. The problem is that the ConnectionFactory
and DataSource
are synthetic ClientProxy
beans. When you do reflection on them, the methods that get returned are those of the generated proxy and not the actual target type.
We could maybe investigate doing ClientProxy.unwrap
before beans get returned from RuntimeBeanRepository
.
Hi @davsclaus what version of camel jbang should be used? I run with 4.7
but there is no --address
JBang version: 0.117.1
Camel JBang version: 4.7.0
Unknown option: '--address'
Usage: camel get endpoint [-h] [--short-uri] [--watch] [--wide-uri]
[--filter=<filter>]
[--filter-direction=<filterDirection>]
[--filter-total=<filterTotal>] [--limit=<limit>]
[--sort=<sort>] [<name>]
Get usage of Camel endpoints
[<name>] Name or pid of running Camel integration
-h, --help Display the help and sub-commands
--watch Execute periodically and showing output fullscreen
--sort=<sort> Sort by pid, name, age or total
--limit=<limit> Filter endpoints by limiting to the given number of
rows
--filter=<filter> Filter endpoints by URI
--filter-direction=<filterDirection>
Filter by direction (in or out)
--filter-total=<filterTotal>
Filter endpoints that must be higher than the given
usage
--short-uri List endpoint URI without query parameters (short)
--wide-uri List endpoint URI in full details
I think we renamed it to camel get service
There is a --metadata
option that shows more data
OK, I run camel get endpoint
to get
PID NAME AGE DIR TOTAL STUB REMOTE URI
44995 camel-1 1h2m x jms://test
but camel get service
return empty result even with --metadata
the blog shows how it should look https://camel.apache.org/blog/2024/07/camel47-whatsnew/
try this example in jbang https://github.com/apache/camel-kamelets-examples/tree/main/jbang/camel-1.0
Thanks a lot @davsclaus !
camel run MyRouteBuilder.java
, the camel get service
returns
PID NAME COMPONENT DIR PROTOCOL SERVICE TOTAL ID ENDPOINT
62506 MyRouteBuilder activemq in jms failover://tcp://localhost:61616 0 route1 activemq://test.MyQueue
camel run MyRouteBuilder.java --runtime=quarkus --quarkus-version=3.13.0 --dep=io.quarkiverse.artemis:quarkus-artemis-jms:3.4.0
, it returns
PID NAME COMPONENT DIR PROTOCOL SERVICE TOTAL ID ENDPOINT
62942 camel-1 activemq in jms failover://tcp://localhost:61616 0 route1 activemq://test.MyQueue
62942 camel-1 activemq out jms failover://tcp://localhost:61616 0 activemq://test.MyQueue
Hmm, why there is another one?
Is there any way to run in a quarkus native mode?
there are 2 because they are IN and OUT
In native I guess you need to add something to that build time graal thingy as it uses reflection to get the data
there are 2 because they are IN and OUT
But why does it appear in quarkus runtime, in plain camel there is only one of IN
?
In native I guess you need to add something to that build time graal thingy as it uses reflection to get the data
I see and is there any option with camel run
to build it in native?
export to quarkus and run the quarkus native build via maven
@davsclaus I'm still confuse why running with the same Java file, there is a different output of camel get service
between the plain camel and quarkus runtime?
@davsclaus if setting camel.main.endpoint-runtime-statistics-enabled=true
, there will be only one IN
result with camel get service
when running with quarkus.
I found the following codes which might be related https://github.com/apache/camel/blob/main/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultEndpointServiceRegistry.java#L93-L99
So @jamesnetherton does it make sense to default enable endpoint-runtime-statistics
in camel-quarkus-cli-connector
?
Also I create https://issues.apache.org/jira/browse/CAMEL-21163
For native support, it looks like even camel-quarkus-cli-connector
is only JVM support right now. So not sure if we can get it working in native.
you see all this extra stats in camel-jbang as it runs camel in dev mode that turn on various stuff. For production mode, then its expected to not see these information from this CLI.
Its a CLI for development / troubleshooting etc.
See ProfileConfigurer
in camel-main
So maybe what quarkus need is that if you use mvn quarkus:dev
then it runs in developer mode, and set this on camel
camelContext.getCamelContextExtension().setProfile("dev");
So maybe what quarkus need is that if you use
mvn quarkus:dev
then it runs in developer mode
Which unfortunately is broken until we get Camel 4.8.0. https://github.com/apache/camel-quarkus/issues/6083.
Ha, thanks @jamesnetherton and I will check it again when 4.8.0
is out.
@davsclaus
you see all this extra stats in camel-jbang as it runs camel in dev mode that turn on various stuff. For production mode, then its expected to not see these information from this CLI.
Its a CLI for development / troubleshooting etc.
IIUC, only when I uses camel run MyRouteBuilder.java --dev
, these extra stats can be returned by camel get service
?
If I run in production like camel run MyRouteBuilder.java --profile=prod
, them should not be listed. Is it right?
But I test with --profile=prod
, them are still be listed.
its only when you have those extra stats you can know for sure if its only IN or OUT - if no stats then you just have both.
Describe the feature here
https://github.com/apache/camel/blob/main/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsServiceLocationHelper.java
https://github.com/apache/camel/blob/main/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlServiceLocationHelper.java
It is blocked by