You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/09/22 06:43:57 UTC
[GitHub] [camel-quarkus] heyplusyou opened a new issue #1816: Camel quarkus disable auto route discovery not working
heyplusyou opened a new issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816
Hi all,
I am currently setting up a camel project based on quarkus and I would like to handle the route activation based on DB entries at runtime. We created a couple of routes in DSL by extending the RouteBuilder and it works fine with route auto discovery.
But to implement the DB and runtime activation I would need to disable the auto discovery. Is there a way to do this?
I found the option
- quarkus.camel.main.routes-discovery.enabled=false
But I still finds the RouteBuilders and starts them during startup.
Quarkus: 1.8.0
Camel Quarkus: 1.1.0
**application.properties**
```
quarkus.camel.routes-discovery.enabled=false
quarkus.camel.routes-discovery.exclude-patterns="de/*"
management.endpoints.web.exposure.include=hawtio,jolokia
quarkus.log.category."org.apache.camel.de.vce.esb.main".level=DEBUG
# DATASOURCE
db.host=${DB_HOST:localhost}
db.port=${DB_PORT:5432}
db.name=${DB_NAME:esb}
quarkus.datasource.url=jdbc:postgresql://${db.host}:${db.port}/${db.name}
quarkus.datasource.driver=org.postgresql.Driver
quarkus.datasource.username=${DB_USERNAME:postgres}
quarkus.datasource.password=${DB_PASSWORD:postgres}
```
**log**
```
2020-09-22 08:13:42,352 INFO [org.apa.cam.qua.cor.CamelBootstrapRecorder] (Quarkus Main Thread) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2020-09-22 08:13:42,365 INFO [org.apa.cam.mai.DefaultConfigurationConfigurer] (Quarkus Main Thread) Using HealthCheckRegistry: org.apache.camel.impl.health.DefaultHealthCheckRegistry@5cee50ae
2020-09-22 08:13:42,382 INFO [org.apa.cam.qua.mai.CamelMainRoutesCollector] (Quarkus Main Thread) Loading additional Camel XML route templates from: classpath:camel-template/*.xml
2020-09-22 08:13:42,389 INFO [org.apa.cam.man.JmxManagementStrategy] (Quarkus Main Thread) JMX is enabled
2020-09-22 08:13:42,445 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.5.0 (camel-1) is starting
2020-09-22 08:13:42,572 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2020-09-22 08:13:42,572 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Using HealthCheck: camel-microprofile-health
2020-09-22 08:13:42,680 INFO [org.apa.cam.imp.eng.InternalRouteStartupManager] (Quarkus Main Thread) Route: testroute started and consuming from: file://XXXXXX
2020-09-22 08:13:42,681 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Total 1 routes, of which 1 are started
2020-09-22 08:13:42,681 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.5.0 (camel-1) started in 0.236 seconds
```
Many thanks!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] lburgazzoli commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696609834
@heyplusyou btw, thinking about it a little bit more, unless you want to add the route yourself, if you only want to activate a route upon a condition, you can disable route's auto-startup as you are already doing, isn't that enough ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] lburgazzoli commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696564124
@heyplusyou how did you define the route ? I mean it's just a RouteBuilder class or annotate with a CDI annotation ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga closed issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
ppalaga closed issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] lburgazzoli commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696657594
For most of the things you can probably rely on properties I guess but let us know so we can eventually enhance what we do
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] heyplusyou commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
heyplusyou commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696580167
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] heyplusyou commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
heyplusyou commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696656183
> ok, now I see what the problem is, working on a fix.
> In the meantime, I think if you remove the `ApplicationScoped` it should not end up being loaded.
I can confirm when I remove the @ApplicationScoped then its not starting automatically. But of course would be great to control it via properties
> @heyplusyou btw, thinking about it a little bit more, unless you want to add the route yourself, if you only want to activate a route upon a condition, you can disable route's auto-startup as you are already doing, isn't that enough ?
Yes and no, my idea was to start the route with different attributes e.g. for test environment I can just switch the directories. But its a good point, let me try it it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] heyplusyou commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
heyplusyou commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696580167
@lburgazzoli defined with @ApplicationScoped
see below
```
@ApplicationScoped
public class TestRouteBuilder extends RouteBuilder {
@Inject
TestConfig testConfig;
@Override
public void configure() {
onException(Exception.class)
.handled(true)
.log("${headers.CamelFileName} could not be processed")
.log("Error:")
.log("${exception.message}")
.log("${exception.stacktrace}")
.to("file:" + testConfig.broilking_directory_error);
from("file:" + testConfig.broilking_directory_in + "?include=.*\\.csv&noop=false")
.autoStartup(ProfileManager.getActiveProfile().equals(RouteProfiles.TEST.getUIName()))
.log("Processing: ${headers.CamelFileName}")
.process(new RoconCSVProcessor(broilKingConfig))
.log("${headers.CamelFileName} successfully processed")
.to("file:" + testConfig.broilking_directory_out);
}
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga closed issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
ppalaga closed issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] lburgazzoli commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696581152
ok, now I see what the problem is, working on a fix.
In the meantime, I think if you remove the `ApplicationScoped` it should not end up being loaded.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] lburgazzoli commented on issue #1816: Camel quarkus disable auto route discovery not working
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1816:
URL: https://github.com/apache/camel-quarkus/issues/1816#issuecomment-696564124
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org