apache / camel-quarkus

Apache Camel Quarkus
https://camel.apache.org
Apache License 2.0
257 stars 192 forks source link

URL to the Kafka brokers must be configured with the brokers option after upgrade to Quarkus 2.1.0.Final #2939

Open ppalaga opened 3 years ago

ppalaga commented 3 years ago

Happens in the Kafka example after the upgrade to Quarkus 2.1.0.Final

[INFO] Running org.apache.camel.example.KafkaTest
2021-07-23 08:45:05,948 WARN  [org.tes.uti.TestcontainersConfiguration] (build-71) Attempted to read Testcontainers configuration file at file:/home/runner/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: /home/runner/.testcontainers.properties (No such file or directory)
2021-07-23 08:45:06,029 INFO  [org.tes.doc.DockerMachineClientProviderStrategy] (build-71) docker-machine executable was not found on PATH ([/opt/hostedtoolcache/jdk-11-hotspot/1.0.0/x64/bin, /home/linuxbrew/.linuxbrew/bin, /home/linuxbrew/.linuxbrew/sbin, /home/runner/.local/bin, /opt/pipx_bin, /usr/share/rust/.cargo/bin, /home/runner/.config/composer/vendor/bin, /usr/local/.ghcup/bin, /home/runner/.dotnet/tools, /snap/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games, /snap/bin])
2021-07-23 08:45:06,644 INFO  [org.tes.doc.DockerClientProviderStrategy] (build-71) Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2021-07-23 08:45:06,647 INFO  [org.tes.DockerClientFactory] (build-71) Docker host IP address is localhost
2021-07-23 08:45:06,704 INFO  [org.tes.DockerClientFactory] (build-71) Connected to docker: 
  Server Version: 20.10.7+azure
  API Version: 1.41
  Operating System: Ubuntu 20.04.2 LTS
  Total Memory: 6953 MB
2021-07-23 08:45:06,704 INFO  [org.tes.DockerClientFactory] (build-71) Checking the system...
2021-07-23 08:45:06,707 INFO  [org.tes.DockerClientFactory] (build-71) ✔︎ Docker server version should be at least 1.6.0
2021-07-23 08:45:06,713 INFO  [org.tes.uti.ImageNameSubstitutor] (build-71) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2021-07-23 08:45:07,109 INFO  [org.tes.DockerClientFactory] (docker-java-stream-1271372458) Starting to pull image
2021-07-23 08:45:07,131 INFO  [org.tes.DockerClientFactory] (docker-java-stream-1271372458) Pulling image layers:  0 pending,  0 downloaded,  0 extracted, (0 bytes/0 bytes)
2021-07-23 08:45:07,298 INFO  [org.tes.DockerClientFactory] (docker-java-stream-1271372458) Pulling image layers:  0 pending,  1 downloaded,  0 extracted, (19 KB/1 MB)
2021-07-23 08:45:07,435 INFO  [org.tes.DockerClientFactory] (docker-java-stream-1271372458) Pulling image layers:  0 pending,  1 downloaded,  1 extracted, (1 MB/1 MB)
2021-07-23 08:45:07,917 INFO  [org.tes.DockerClientFactory] (build-71) ✔︎ Docker environment should have more than 2GB free disk space
2021-07-23 08:45:08,069 INFO  [🐳 .5.5]] (build-71) Pulling docker image: vectorized/redpanda:v21.5.5. Please be patient; this may take some time but only needs to be done once.
2021-07-23 08:45:08,385 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Starting to pull image
2021-07-23 08:45:08,387 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  0 downloaded,  0 extracted, (0 bytes/0 bytes)
2021-07-23 08:45:08,465 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  6 pending,  1 downloaded,  0 extracted, (335 bytes/? MB)
2021-07-23 08:45:08,593 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  5 pending,  2 downloaded,  0 extracted, (622 KB/? MB)
2021-07-23 08:45:08,694 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  4 pending,  3 downloaded,  0 extracted, (26 MB/? MB)
2021-07-23 08:45:08,719 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  3 pending,  4 downloaded,  0 extracted, (44 MB/? MB)
2021-07-23 08:45:08,720 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  2 pending,  5 downloaded,  0 extracted, (44 MB/? MB)
2021-07-23 08:45:08,791 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  1 pending,  6 downloaded,  0 extracted, (44 MB/? MB)
2021-07-23 08:45:10,266 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  1 pending,  6 downloaded,  1 extracted, (239 MB/? MB)
2021-07-23 08:45:10,329 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  7 downloaded,  1 extracted, (251 MB/260 MB)
2021-07-23 08:45:12,155 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  7 downloaded,  2 extracted, (252 MB/260 MB)
2021-07-23 08:45:12,238 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  7 downloaded,  3 extracted, (252 MB/260 MB)
2021-07-23 08:45:12,300 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  7 downloaded,  4 extracted, (252 MB/260 MB)
2021-07-23 08:45:12,360 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  7 downloaded,  5 extracted, (252 MB/260 MB)
2021-07-23 08:45:12,421 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  7 downloaded,  6 extracted, (252 MB/260 MB)
2021-07-23 08:45:19,661 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pulling image layers:  0 pending,  7 downloaded,  7 extracted, (260 MB/260 MB)
2021-07-23 08:45:19,669 INFO  [🐳 .5.5]] (docker-java-stream--1890219899) Pull complete. 7 layers, pulled in 11s (downloaded 260 MB at 23 MB/s)
2021-07-23 08:45:19,697 INFO  [🐳 .5.5]] (build-71) Creating container for image: vectorized/redpanda:v21.5.5
2021-07-23 08:45:19,777 INFO  [🐳 .5.5]] (build-71) Starting container with ID: 2f0c1f411763c79ea3ef5a87f09955846f8d3bc1bf4915ff366d72f92eb9df4d
2021-07-23 08:45:20,154 INFO  [🐳 .5.5]] (build-71) Container vectorized/redpanda:v21.5.5 is starting: 2f0c1f411763c79ea3ef5a87f09955846f8d3bc1bf4915ff366d72f92eb9df4d
2021-07-23 08:45:21,367 INFO  [🐳 .5.5]] (build-71) Container vectorized/redpanda:v21.5.5 started in PT13.312943S
2021-07-23 08:45:21,368 INFO  [io.qua.kaf.cli.dep.DevServicesKafkaProcessor] (build-71) Dev Services for Kafka started. Other Quarkus applications in dev mode will find the broker automatically. For Quarkus applications in production mode, you can connect to this by starting your application with -Dkafka.bootstrap.servers=PLAINTEXT://localhost:49154
2021-07-23 08:45:22,642 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2021-07-23 08:45:22,783 ERROR [org.apa.cam.imp.eng.AbstractCamelContext] (main) Error starting CamelContext (camel-1) due to exception thrown: Failed to start route FromTimer2Kafka because of null: org.apache.camel.FailedToStartRouteException: Failed to start route FromTimer2Kafka because of null
    at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123)
    at org.apache.camel.impl.engine.InternalRouteStartupManager.doWarmUpRoutes(InternalRouteStartupManager.java:306)
    at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:189)
    at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:147)
    at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:3166)
    at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2846)
    at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2797)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2494)
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:245)
    at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:94)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:139)
    at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
    at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot-173480958.deploy_0(CamelBootstrapProcessor$boot-173480958.zig:101)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot-173480958.deploy(CamelBootstrapProcessor$boot-173480958.zig:40)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:821)
    at io.quarkus.runtime.Application.start(Application.java:101)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:181)
    at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:357)
    at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:654)
    at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:701)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$8(ClassBasedTestDescriptor.java:368)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:368)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:192)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:136)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: URL to the Kafka brokers must be configured with the brokers option.
    at org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException(RuntimeCamelException.java:51)
    at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:67)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:130)
    at org.apache.camel.impl.engine.DefaultChannel.doStart(DefaultChannel.java:126)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:116)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:130)
    at org.apache.camel.processor.Pipeline.doStart(Pipeline.java:221)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:89)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.impl.engine.RouteService.startChildServices(RouteService.java:396)
    at org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:193)
    at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
    ... 65 more
Caused by: java.lang.IllegalArgumentException: URL to the Kafka brokers must be configured with the brokers option.
    at org.apache.camel.component.kafka.DefaultKafkaClientFactory.getBrokers(DefaultKafkaClientFactory.java:42)
    at org.apache.camel.component.kafka.KafkaProducer.getProps(KafkaProducer.java:73)
    at org.apache.camel.component.kafka.KafkaProducer.doStart(KafkaProducer.java:105)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.impl.engine.AbstractCamelContext.internalAddService(AbstractCamelContext.java:1462)
    at org.apache.camel.impl.engine.AbstractCamelContext.addService(AbstractCamelContext.java:1383)
    at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:247)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:130)
    at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1638)
    at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:60)
    ... 81 more

2021-07-23 08:45:22,838 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.11.0 (camel-1) shutting down
2021-07-23 08:45:22,842 INFO  [org.apa.cam.com.kaf.KafkaConsumer] (main) Stopping Kafka consumer on topic: test
2021-07-23 08:45:22,850 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Routes shutdown summary (total:2 stopped:2)
2021-07-23 08:45:22,854 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Stopped FromTimer2Kafka (timer://foo)
2021-07-23 08:45:22,854 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Stopped FromKafka2Seda (kafka://test)
2021-07-23 08:45:22,863 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.11.0 (camel-1) shutdown in 18ms (uptime:77ms)
2021-07-23 08:45:22,864 WARN  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Lifecycle strategy org.apache.camel.impl.engine.OnCamelContextLifecycleStrategy@18d42e4e failed on CamelContext (camel-1) due to: null. This exception will be ignored
2021-07-23 08:45:22,864 ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (main) Failed to start application: org.apache.camel.FailedToStartRouteException: Failed to start route FromTimer2Kafka because of null
    at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123)
    at org.apache.camel.impl.engine.InternalRouteStartupManager.doWarmUpRoutes(InternalRouteStartupManager.java:306)
    at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:189)
    at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:147)
    at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:3166)
    at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2846)
    at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2797)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2494)
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:245)
    at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:94)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:139)
    at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
    at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot-173480958.deploy_0(CamelBootstrapProcessor$boot-173480958.zig:101)
    at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot-173480958.deploy(CamelBootstrapProcessor$boot-173480958.zig:40)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:821)
    at io.quarkus.runtime.Application.start(Application.java:101)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:181)
    at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:357)
    at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:654)
    at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:701)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$8(ClassBasedTestDescriptor.java:368)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:368)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:192)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:136)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: URL to the Kafka brokers must be configured with the brokers option.
    at org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException(RuntimeCamelException.java:51)
    at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:67)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:130)
    at org.apache.camel.impl.engine.DefaultChannel.doStart(DefaultChannel.java:126)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:116)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:130)
    at org.apache.camel.processor.Pipeline.doStart(Pipeline.java:221)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:89)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.impl.engine.RouteService.startChildServices(RouteService.java:396)
    at org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:193)
    at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
    ... 65 more
Caused by: java.lang.IllegalArgumentException: URL to the Kafka brokers must be configured with the brokers option.
    at org.apache.camel.component.kafka.DefaultKafkaClientFactory.getBrokers(DefaultKafkaClientFactory.java:42)
    at org.apache.camel.component.kafka.KafkaProducer.getProps(KafkaProducer.java:73)
    at org.apache.camel.component.kafka.KafkaProducer.doStart(KafkaProducer.java:105)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.impl.engine.AbstractCamelContext.internalAddService(AbstractCamelContext.java:1462)
    at org.apache.camel.impl.engine.AbstractCamelContext.addService(AbstractCamelContext.java:1383)
    at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:247)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
    at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:130)
    at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1638)
    at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:60)
    ... 81 more

Error:  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 24.352 s <<< FAILURE! - in org.apache.camel.example.KafkaTest
Error:  testKafka  Time elapsed: 0.008 s  <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: org.apache.camel.FailedToStartRouteException: Failed to start route FromTimer2Kafka because of null
Caused by: java.lang.RuntimeException: org.apache.camel.FailedToStartRouteException: Failed to start route FromTimer2Kafka because of null
Caused by: org.apache.camel.FailedToStartRouteException: Failed to start route FromTimer2Kafka because of null
Caused by: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: URL to the Kafka brokers must be configured with the brokers option.
Caused by: java.lang.IllegalArgumentException: URL to the Kafka brokers must be configured with the brokers option.

[INFO] 
[INFO] Results:
[INFO] 
Error:  Errors: 
Error:    KafkaTest.testKafka » Runtime java.lang.RuntimeException: Failed to start quar...

Probably related to https://github.com/apache/camel-quarkus/commit/d6a909130b58baf2ed5224b7547dad52f0b069e8

ppalaga commented 3 years ago

Adding camel.component.kafka.brokers=${kafka.bootstrap.servers:${brokers}} to application.properties can serve as a workaround.

sed108 commented 2 years ago

The workaround suggested above no longer seems to work with quarkus 2.8.0 and camel 3.16.0

When using the suggested new line in application.properties: camel.component.kafka.brokers=${kafka.bootstrap.servers:${brokers}}

The following error was received:

[INFO] Running org.acme.kafka.KafkaTest
2022-04-21 09:35:03,922 INFO  [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final
2022-04-21 09:35:05,728 INFO  [org.tes.doc.DockerClientProviderStrategy] (build-41) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2022-04-21 09:35:06,554 INFO  [org.tes.doc.DockerClientProviderStrategy] (build-41) Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2022-04-21 09:35:06,556 INFO  [org.tes.DockerClientFactory] (build-41) Docker host IP address is localhost
2022-04-21 09:35:06,686 INFO  [org.tes.DockerClientFactory] (build-41) Connected to docker: 
  Server Version: 20.10.13
  API Version: 1.41
  Operating System: Ubuntu 20.04.4 LTS
  Total Memory: 15967 MB
2022-04-21 09:35:06,694 INFO  [org.tes.uti.ImageNameSubstitutor] (build-41) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2022-04-21 09:35:07,823 INFO  [org.tes.DockerClientFactory] (build-41) Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
2022-04-21 09:35:07,824 INFO  [org.tes.DockerClientFactory] (build-41) Checking the system...
2022-04-21 09:35:07,825 INFO  [org.tes.DockerClientFactory] (build-41) ✔︎ Docker server version should be at least 1.6.0
2022-04-21 09:35:07,978 INFO  [org.tes.DockerClientFactory] (build-41) ✔︎ Docker environment should have more than 2GB free disk space
2022-04-21 09:35:08,056 INFO  [🐳 .io/.11.3]] (build-41) Creating container for image: docker.io/vectorized/redpanda:v21.11.3
2022-04-21 09:35:08,362 INFO  [🐳 .io/.11.3]] (build-41) Container docker.io/vectorized/redpanda:v21.11.3 is starting: 6df98a93ccb0ee4f70a54f4d6eb6b73b31e06976b3148eb3cda0e562b8025a20
2022-04-21 09:35:10,156 INFO  [🐳 .io/.11.3]] (build-41) Container docker.io/vectorized/redpanda:v21.11.3 started in PT2.148818S
2022-04-21 09:35:10,158 INFO  [io.qua.kaf.cli.dep.DevServicesKafkaProcessor] (build-41) Dev Services for Kafka started. Other Quarkus applications in dev mode will find the broker automatically. For Quarkus applications in production mode, you can connect to this by starting your application with -Dkafka.bootstrap.servers=OUTSIDE://localhost:50552
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.878 s <<< FAILURE! - in org.acme.kafka.KafkaTest
[ERROR] testKafka  Time elapsed: 0.024 s  <<< ERROR!
java.lang.RuntimeException: 
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step org.apache.camel.quarkus.component.kafka.deployment.KafkaProcessor#configureKafkaComponentForDevServices threw an exception: java.util.NoSuchElementException: SRCFG00011: Could not expand value brokers in property camel.component.kafka.brokers
    at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:63)
    at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
    at io.smallrye.common.expression.CompositeNode.emit(CompositeNode.java:22)
    at io.smallrye.common.expression.ResolveContext.emitToBuilder(ResolveContext.java:69)
    at io.smallrye.common.expression.ResolveContext.expandDefault(ResolveContext.java:56)
    at io.smallrye.common.expression.ResolveContext.expandDefault(ResolveContext.java:84)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:61)
    at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
    at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
    at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:56)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:36)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.PropertyNamesConfigSourceInterceptor.getValue(PropertyNamesConfigSourceInterceptor.java:61)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:305)
    at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:223)
    at io.smallrye.config.SmallRyeConfig.getOptionalValue(SmallRyeConfig.java:322)
    at org.apache.camel.quarkus.component.kafka.deployment.KafkaProcessor.configureKafkaComponentForDevServices(KafkaProcessor.java:73)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
    at java.base/java.lang.Thread.run(Thread.java:829)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Caused by: java.lang.RuntimeException: 
io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step org.apache.camel.quarkus.component.kafka.deployment.KafkaProcessor#configureKafkaComponentForDevServices threw an exception: java.util.NoSuchElementException: SRCFG00011: Could not expand value brokers in property camel.component.kafka.brokers
    at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:63)
    at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
    at io.smallrye.common.expression.CompositeNode.emit(CompositeNode.java:22)
    at io.smallrye.common.expression.ResolveContext.emitToBuilder(ResolveContext.java:69)
    at io.smallrye.common.expression.ResolveContext.expandDefault(ResolveContext.java:56)
    at io.smallrye.common.expression.ResolveContext.expandDefault(ResolveContext.java:84)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:61)
    at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
    at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
    at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:56)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:36)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.PropertyNamesConfigSourceInterceptor.getValue(PropertyNamesConfigSourceInterceptor.java:61)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:305)
    at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:223)
    at io.smallrye.config.SmallRyeConfig.getOptionalValue(SmallRyeConfig.java:322)
    at org.apache.camel.quarkus.component.kafka.deployment.KafkaProcessor.configureKafkaComponentForDevServices(KafkaProcessor.java:73)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
    at java.base/java.lang.Thread.run(Thread.java:829)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Caused by: io.quarkus.builder.BuildException: 
Build failure: Build failed due to errors
    [error]: Build step org.apache.camel.quarkus.component.kafka.deployment.KafkaProcessor#configureKafkaComponentForDevServices threw an exception: java.util.NoSuchElementException: SRCFG00011: Could not expand value brokers in property camel.component.kafka.brokers
    at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:63)
    at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
    at io.smallrye.common.expression.CompositeNode.emit(CompositeNode.java:22)
    at io.smallrye.common.expression.ResolveContext.emitToBuilder(ResolveContext.java:69)
    at io.smallrye.common.expression.ResolveContext.expandDefault(ResolveContext.java:56)
    at io.smallrye.common.expression.ResolveContext.expandDefault(ResolveContext.java:84)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:61)
    at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
    at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
    at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:56)
    at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:36)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.PropertyNamesConfigSourceInterceptor.getValue(PropertyNamesConfigSourceInterceptor.java:61)
    at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
    at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:305)
    at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:223)
    at io.smallrye.config.SmallRyeConfig.getOptionalValue(SmallRyeConfig.java:322)
    at org.apache.camel.quarkus.component.kafka.deployment.KafkaProcessor.configureKafkaComponentForDevServices(KafkaProcessor.java:73)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
    at java.base/java.lang.Thread.run(Thread.java:829)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Caused by: java.util.NoSuchElementException: SRCFG00011: Could not expand value brokers in property camel.component.kafka.brokers

Similar errors for variations of the property:

Property: camel.component.kafka.brokers=${brokers:${kafka.bootstrap.servers}} Error: Caused by: java.util.NoSuchElementException: SRCFG00011: Could not expand value kafka.bootstrap.servers in property camel.component.kafka.brokers

Property: camel.component.kafka.brokers=${kafka.bootstrap.servers} Error: Caused by: java.util.NoSuchElementException: SRCFG00011: Could not expand value kafka.bootstrap.servers in property camel.component.kafka.brokers

sed108 commented 2 years ago

A new workaround was identified here: https://github.com/apache/camel-quarkus-examples/pull/86

%prod.camel.component.kafka.brokers=${kafka.bootstrap.servers}
zbendhiba commented 2 years ago

The bug on dev mode/ test mode is outdated. I think the config line %prod.camel.component.kafka.brokers=${kafka.bootstrap.servers} should be deleted, as this is not used for dev mode or test mode. Let me check this

zhfeng commented 2 years ago

@zbendhiba I think it has to add this option, please check https://github.com/apache/camel-quarkus/issues/3742#issuecomment-1120533897

zbendhiba commented 2 years ago

I'm 1000% sure on dev mode it works without any workaround. As I use it all the time on my demos.

I guess the problem here gets from using Kafka dev services in the tests, and I'm not sure if this is a Quarkus feature, maybe just a mistake of mine.

Let me check

zbendhiba commented 2 years ago

@zhfeng what's happening here is that the test profile doesn't have the same behaviour as dev mode. And you are tricking it but letting it fallback to prod. When the tests run, we aren't in the dev mode. So how does it get the kafka brokers. And if we do something for tests, how do we differentiate dev and test while running dev mode. I don't know if Quarkus folks deal with this, or if the right way to do is have dev services on dev mode, and have another test resource for tests.

I don't thing it's a big bug. It's a nice to have but not something urgent. The solution here is as simple as adding a TestResource class to handle the kafka instance

zhfeng commented 2 years ago

@zbendhiba it's only needed when running the IT tests in native mode.

In test or dev mode, we add a RunTimeConfigurationDefaultBuildItem in KafkaProcessor but it does not work in native mode.

I raise a PR which introduces a BuildItem in DevKafkaService to add additional config but it did not be accepted by Quarkus team.

So we still need to add %prod.camel.component.kafka.brokers=${kafka.bootstrap.servers} as a workaround for running IT test in native mode.

zhfeng commented 2 years ago

But for this issue I think it could be closed since it has been resolved in test or dev mode.

zbendhiba commented 2 years ago

@zhfeng Yeah, thanks for explanation. and for pointing out to the interesting discussion around your PR IMHO, we need to just have a TestResource doing the right config, as we do in our integration tests. I would prefer to tell users to create a TestResource class for kafka container, but if they really insist on using dev services for their integration tests, point to this trick.

BTW, I'm planning on deleting this example, as it doesn't bring anything new compared to what we have already in our many kafka integration tests

zhfeng commented 2 years ago

yeah, please leave some notes in the document about running the IT test in the native mode with KafkaDevService. Thanks!

jamesnetherton commented 2 years ago

Let me take a deeper look into this. We may be able to work some magic to get this working for the native use case with TestBuildChainCustomizerProducer, it needs some experimantation.

zhfeng commented 2 years ago

Hmm, nice catch! @jamesnetherton How do you get it? :)

jamesnetherton commented 2 years ago

How do you get it?

It's amazing what you discover when debugging your way through the Quarkus test framework code :wink:

zhfeng commented 2 years ago

@jamesnetherton any update?

jamesnetherton commented 2 years ago

@jamesnetherton any update?

I can't make it work with TestBuildChainCustomizerProducer 😞. I have one other idea that I'd like to investigate. If that doesn't work, then we'll have to document some workarounds.

jamesnetherton commented 2 years ago

I found a way with NativeImageLauncher https://github.com/jamesnetherton/camel-quarkus/commit/dfc26156f40797a10424759505f3266558d99938.

Executing "camel-quarkus-examples/kafka/target/camel-quarkus-examples-kafka-2.10.0-SNAPSHOT-runner -Dquarkus.http.port=8081 -Dquarkus.http.ssl-port=8444 -Dtest.url=http://localhost:8081 -Dquarkus.log.file.path=/home/james/Projects/camel-quarkus-examples/kafka/target/quarkus.log -Dquarkus.log.file.enable=true -Dkafka.bootstrap.servers=OUTSIDE://localhost:49192  -Dcamel.component.kafka.brokers=OUTSIDE://localhost:49192"

Not sure if the Kafka extension is the best place for such code - WDYT? Maybe the better long term solution would be to have a dedicated camel-quarkus-test dependency that we bundle stuff like this into (and eventually also the code for whatever solution comes out of #3511).

If we think this solution is too heavyweight, then we could just document the workarounds.

zhfeng commented 2 years ago

Thanks @jamesnetherton and it looks good to me. It definetly need camel-quarkus-test dependecy and maybe have a genernal BuildItem to colloect the configs which need to pass to NativeImageLauncher.

zbendhiba commented 2 years ago

@jamesnetherton nice idea, but I would prefer to open an issue describing the idea about why having a camel-quarkus-test dependency, share the link and gather feedbacks for it. Before deciding whether we have enough value to go to this road

jamesnetherton commented 2 years ago

@zbendhiba The value add of having a dedicated test dependency is already mostly agreed upon. See https://github.com/apache/camel-quarkus/issues/3511 & #3847.