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 2021/05/19 17:16:16 UTC

[GitHub] [camel-quarkus] KMUS opened a new issue #2632: No consumers available on endpoint

KMUS opened a new issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632


   Declaring a class with @Consume annotation always fails. See below for complete error message. An other issue I want to point out is, a missing @Inject on @Produce("direct:startHere") results in a npe.
   
   I am grateful for any help.
   
   Main.class
   ```
   public class Main implements QuarkusApplication {
   
       @Inject
       CamelStarter starter;
   
       @Override
       public int run(String... args) throws Exception {
           starter.run();
           return 0;
       }
   
       public static void main(String[] args) {
           Quarkus.run(Main.class, args);
       }
   }
   ```
   
   CamelStarter .class
   ```
   @Dependent
   public class CamelStarter {
   
       @Inject
       @Produce("direct:startHere")
       ProducerTemplate producer;
   
       public void run() {
           producer.sendBody("ApacheCamel");
           Quarkus.waitForExit();
       }
   
   }
   ```
   
   CamelRoutes .class
   ```
   @ApplicationScoped
   public class CamelRoutes extends RouteBuilder {
   
       @Override
       public void configure() {
           from("direct:startHere")
                   .to("direct:bar");
       }
   }
   ```
   
   Bar.class
   ```
   public class Bar {
   
       @Consume("direct:bar")
       public void onBar(String str) {
           System.out.println("onBar: " + str);
       }
   }
   ```
   
   ```
   [org.apa.cam.qua.cor.CamelBootstrapRecorder] (Quarkus Main Thread) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
   [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Routes startup summary (total:1 started:1)
   [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Started route1 (direct://startHere)
   [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.9.0 (camel-1) started in 54ms (build:0ms init:38ms start:16ms)
   [io.quarkus] (Quarkus Main Thread) Quarkus 1.13.4.Final on JVM started in 1.792s. 
   [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
   [io.quarkus] (Quarkus Main Thread) Installed features: [camel-bean, camel-core, camel-direct, camel-file, camel-log, camel-support-common, camel-timer, cdi, picocli]
   ```
   
   ```
   org.apache.camel.component.direct.DirectConsumerNotAvailableException: No consumers available on endpoint: direct://bar. Exchange[]
   
   Message History (complete message history is disabled)
   ---------------------------------------------------------------------------------------------------------------------------------------
   RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
   [route1            ] [route1            ] [from[direct://startHere]                                                      ] [     30006]
   	...
   [route1            ] [to1               ] [direct:bar                                                                    ] [         0]
   
   Stacktrace
   ---------------------------------------------------------------------------------------------------------------------------------------
   : org.apache.camel.component.direct.DirectConsumerNotAvailableException: No consumers available on endpoint: direct://bar. Exchange[]
   	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:82)
   	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
   	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:439)
   	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
   	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:62)
   	at org.apache.camel.processor.Pipeline.process(Pipeline.java:167)
   	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:388)
   	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:96)
   	at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:217)
   	at org.apache.camel.impl.engine.SharedCamelInternalProcessor$1.process(SharedCamelInternalProcessor.java:111)
   	at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)
   	at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:108)
   	at org.apache.camel.support.cache.DefaultProducerCache.send(DefaultProducerCache.java:190)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:153)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:187)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:457)
   	at x.y.CamelStarter.run(CamelStarter.java:21)
   	at x.y.CamelStarter_Subclass.run$$superaccessor1(CamelStarter_Subclass.zig:189)
   	at x.y.CamelStarter_Subclass$$function$$1.apply(CamelStarter_Subclass$$function$$1.zig:29)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.CamelStarter_Subclass.run(CamelStarter_Subclass.zig:147)
   	at x.y.Main.run(Main.java:18)
   	at x.y.Main_ClientProxy.run(Main_ClientProxy.zig:129)
   	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:122)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
   	at x.y.Main.main(Main.java:23)
   	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$3.run(StartupActionImpl.java:134)
   	at java.base/java.lang.Thread.run(Thread.java:834)
   
   2021-05-19 19:01:59,428 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): org.apache.camel.component.direct.DirectConsumerNotAvailableException: No consumers available on endpoint: direct://bar. Exchange[]
   	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:82)
   	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
   	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:439)
   	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
   	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:62)
   	at org.apache.camel.processor.Pipeline.process(Pipeline.java:167)
   	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:388)
   	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:96)
   	at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:217)
   	at org.apache.camel.impl.engine.SharedCamelInternalProcessor$1.process(SharedCamelInternalProcessor.java:111)
   	at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)
   	at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:108)
   	at org.apache.camel.support.cache.DefaultProducerCache.send(DefaultProducerCache.java:190)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:153)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:187)
   	at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:457)
   	at x.y.CamelStarter.run(CamelStarter.java:21)
   	at x.y.CamelStarter_Subclass.run$$superaccessor1(CamelStarter_Subclass.zig:189)
   	at x.y.CamelStarter_Subclass$$function$$1.apply(CamelStarter_Subclass$$function$$1.zig:29)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.CamelStarter_Subclass.run(CamelStarter_Subclass.zig:147)
   	at x.y.Main.run(Main.java:18)
   	at x.y.Main_ClientProxy.run(Main_ClientProxy.zig:129)
   	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:122)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
   	at x.y.Main.main(Main.java:23)
   	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$3.run(StartupActionImpl.java:134)
   	at java.base/java.lang.Thread.run(Thread.java:834)
   
   2021-05-19 19:01:59,428 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.9.0 (camel-1) shutting down
   2021-05-19 19:01:59,428 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Routes shutdown summary (total:1 stopped:1)
   2021-05-19 19:01:59,428 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread)     Stopped route1 (direct://startHere)
   2021-05-19 19:01:59,428 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.9.0 (camel-1) shutdown in 0ms (uptime:30s42ms)
   2021-05-19 19:01:59,476 INFO  [io.quarkus] (Quarkus Main Thread) Quarkus stopped in 0.053s
   ```


-- 
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] KMUS edited a comment on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
KMUS edited a comment on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-845254233


   Version 1.9.0 built and included
   
   >        <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-direct</artifactId>
   >             <version>1.9.0-SNAPSHOT</version>            
   >         </dependency>              
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-bean</artifactId>
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-file</artifactId>
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-kafka</artifactId>           
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-timer</artifactId>          
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-rabbitmq</artifactId>          
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-reactive-streams</artifactId>          
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>                 
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-log</artifactId>   
   >             <version>1.9.0-SNAPSHOT</version>                     
   >         </dependency>
   
   1.) The new version seems to fix that issue 'No consumers available on endpoint' but still results in a npe. Injection works fine with @Inject on @Produce. According to the docs, it should work without inject too.
   ```
   @Dependent
   public class CamelRunner {
   
       @Produce("direct:runner")
       ProducerTemplate producer;
   ```
   ```
   java.lang.NullPointerException
   	at x.y.CamelRunner.run(CamelRunner.java:38)
   	at x.y.CamelRunner_Subclass.run$$superaccessor1(CamelRunner_Subclass.zig:189)
   	at x.y.CamelRunner_Subclass$$function$$1.apply(CamelRunner_Subclass$$function$$1.zig:29)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.CamelRunner_Subclass.run(CamelRunner_Subclass.zig:147)
   	at x.y.Main.run(Main.java:25)
   	at x.y.Main_Subclass.run$$superaccessor2(Main_Subclass.zig:327)
   	at x.y.Main_Subclass$$function$$2.apply(Main_Subclass$$function$$2.zig:29)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.Main_Subclass.run(Main_Subclass.zig:285)
   	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
   	at picocli.CommandLine.access$1300(CommandLine.java:145)
   	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
   	at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
   	at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
   	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
   	at picocli.CommandLine.execute(CommandLine.java:2078)
   	at x.y.Main.run(Main.java:30)
   	at x.y.Main_Subclass.run$$superaccessor1(Main_Subclass.zig:220)
   	at x.y.Main_Subclass$$function$$1.apply(Main_Subclass$$function$$1.zig:33)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.Main_Subclass.run(Main_Subclass.zig:181)
   	at x.y.Main_ClientProxy.run(Main_ClientProxy.zig:158)
   	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:122)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
   	at x.y.Main.main(Main.java:34)
   	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$3.run(StartupActionImpl.java:134)
   	at java.base/java.lang.Thread.run(Thread.java:834)
   ```
   
   2.) Unused bean is removed during build. Adding @Unremovable will not call onBar anymore.
   
   ```
   @ApplicationScoped
   public class Bar {
   
       @Consume("direct:bar")
       public void onBar(String str) {
       }
   }
   ```
   ```
   ================================================================================
   CDI: programmatic lookup problem detected
   -----------------------------------------
   At least one bean matched the required type and qualifiers but was marked as unused and removed during build
   Removed beans:
   	- CLASS bean x.y.Bar [types=[class x.y.Bar], qualifiers=[@javax.enterprise.inject.Default(), @javax.enterprise.inject.Any()]]
   Required type: class x.y.Bar
   Required qualifiers: []
   Solutions:
   	- Application developers can eliminate false positives via the @Unremovable annotation
   	- Extensions can eliminate false positives via build items, e.g. using the UnremovableBeanBuildItem
   	- See also https://quarkus.io/guides/cdi-reference#remove_unused_beans
   ================================================================================
   ```
   ```
   @ApplicationScoped
   @Unremovable
   public class Bar {
   
       @Consume("direct:bar")
       public void onBar(String str) {
       }
   }
   
   @ApplicationScoped
   public class MutinyTest {
   
       @Inject
       CamelContext context;
   
       Subscriber<String> subscriber;
   
       @PostConstruct
       public void init() {
           subscriber = CamelReactiveStreams.get(context)
               .subscriber("direct:foo-notification", String.class);
       }
   
       @Incoming("foo-notification") // mutiny
       public void consume(String notify) {
           subscriber.onNext(notify);
       }
   }
   
   from("direct:foo-notification").to("direct:bar");
   ```


-- 
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] KMUS edited a comment on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
KMUS edited a comment on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-845808690


   I am sorry, sure.
   Some errors are gone, some still remains. Hope this is enough to reproduce it.
   
   ```
   @TopCommand
   @Command(name = "cli", mixinStandardHelpOptions = true, version = "cli 0.1")
   public class Main implements QuarkusApplication, Runnable {
   
       @Inject
       CamelRunner starter;
   
       @Override
       public void run() {
           starter.run();
       }
   
       @Override
       public int run(String... args) throws Exception {
           return new CommandLine(this).execute(args);
       }
   
       public static void main(String[] args) {
           Quarkus.run(Main.class, args);
       }
   }
   
   @Dependent
   public class CamelRunner {
   
       @Inject // or producer is null
       @Produce("direct:runner")
       ProducerTemplate producer;
   
       public void run() {
           try {
               producer.sendBody("test");
   
               Quarkus.waitForExit();
           } catch (Exception ex) {
               ex.printStackTrace();
           }
       }
   
   }
   
   @ApplicationScoped
   public class CamelRoutes extends RouteBuilder {
   
       @Override
       public void configure() {
           from("direct:runner")
                   .bean(Bar.class, "onBar(${body})") // calling this at first will fix the issue not calling  Bar#onBar
                   .log("${body}");
   
           from("timer://foo-timer?fixedRate=true&period=5000")
                   .setBody(constant("foo-test"))
                   .to("reactive-streams:foo-notification1");
   
           from("reactive-streams:foo-notification2")
                   .to("direct:foo-notification2");
   
           from("direct:foo-notification2")
                   .to("direct:foo-notification3"); // does not call Bar#onBar
   
   //        from("direct:foo-notification2")
   //                .bean(Bar.class, "onBar"); // works fine
       }
   }
   
   public class Bar {
   
       @Consume("direct:foo-notification3")
       public void onBar(String str) {
           System.out.println("Bar#onBar: " + str);
       }
   }
   
   @ApplicationScoped
   public class Foo {
   
       @Inject
       CamelContext context;
   
       Subscriber<String> subscriber;
   
       @PostConstruct
       public void init() {
           subscriber = CamelReactiveStreams.get(context)
               .streamSubscriber("foo-notification2", String.class);
       }
   
       @Incoming("foo-mutiny-notification")
       public void consume(String notify) {
           subscriber.onNext(notify);
       }
   
       @Outgoing("foo-mutiny-notification")
       public Publisher<String> consume() {
           var camel = CamelReactiveStreams.get(context);
           return camel.fromStream("foo-notification1", String.class);
       }
   }
   ```
   
   ```
   application.properties
   
   quarkus.banner.enabled=false
   quarkus.package.main-class=foo.bar.Main
   
   pom.xml
   
   <?xml version="1.0"?>
   <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <modelVersion>4.0.0</modelVersion>
       <groupId>foo.bar</groupId>
       <artifactId>command-mode</artifactId>
       <version>1.0.0-SNAPSHOT</version>
       <dependencyManagement>
           <dependencies>
               <dependency>
                   <groupId>io.quarkus</groupId>
                   <artifactId>quarkus-universe-bom</artifactId>
                   <version>1.13.4.Final</version>
                   <type>pom</type>
                   <scope>import</scope>
               </dependency>
           </dependencies>
       </dependencyManagement>
       <dependencies>
           <dependency>
               <groupId>io.quarkus</groupId>
               <artifactId>quarkus-picocli</artifactId>
           </dependency> 
           <dependency>
               <groupId>io.quarkus</groupId>
               <artifactId>quarkus-smallrye-reactive-messaging</artifactId>
           </dependency>                   
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-direct</artifactId>
               <version>1.9.0-SNAPSHOT</version>            
           </dependency>              
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-bean</artifactId>
               <version>1.9.0-SNAPSHOT</version>
           </dependency>  
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-timer</artifactId>          
               <version>1.9.0-SNAPSHOT</version>
           </dependency>   
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-reactive-streams</artifactId>          
               <version>1.9.0-SNAPSHOT</version>
           </dependency>  
       </dependencies>               
       <build>
           <plugins>
               <plugin>
                   <groupId>io.quarkus</groupId>
                   <artifactId>quarkus-maven-plugin</artifactId>
                   <version>1.13.4.Final</version>
                   <extensions>true</extensions>
                   <executions>
                       <execution>
                           <goals>
                               <goal>build</goal>
                               <goal>generate-code</goal>
                               <goal>generate-code-tests</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
               <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-compiler-plugin</artifactId>
                   <version>3.8.1</version>
               </plugin>                       
           </plugins>
       </build>
       <properties>
           <maven.compiler.source>11</maven.compiler.source>
           <maven.compiler.target>11</maven.compiler.target>
       </properties>
   </project>
   
   ```


-- 
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 commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
ppalaga commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-848698022


   A minimal self contained reproducer in form of an attached zip or a github repo would highly increase the chances that somebody will have a look. 


-- 
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 commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
ppalaga commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-844973176


   Support for `@Consume` was added to main branch very recently. It will be available in Camel Quarkus 1.9.0. Would you mind testing with our main branch so that we can fix any issues before we release? Here is how to build: https://camel.apache.org/camel-quarkus/latest/contributor-guide/index.html#how-to-build


-- 
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] KMUS commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
KMUS commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-848617225


   @ppalaga 
   Any news on this or is not possible to reproduce the issue?


-- 
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] jamesnetherton closed issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-876496462


   I ran the attached code sample using `quarkus-universe-bom` 2.0.1.Final and the problem seems to be resolved now. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
ppalaga commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-845513290


   Could you please post a minimal reproducer? It is a bit hard to tell from the fragments what is going wrong.


-- 
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] KMUS commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
KMUS commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-845808690


   I am sorry, sure.
   Some errors are gone, some still remains. Hope this is enough to reproduce it.
   
   ```
   @TopCommand
   @Command(name = "cli", mixinStandardHelpOptions = true, version = "cli 0.1")
   public class Main implements QuarkusApplication, Runnable {
   
       @Inject
       CamelRunner starter;
   
       @Override
       public void run() {
           starter.run();
       }
   
       @Override
       public int run(String... args) throws Exception {
           return new CommandLine(this).execute(args);
       }
   
       public static void main(String[] args) {
           Quarkus.run(Main.class, args);
       }
   }
   
   @Dependent
   public class CamelRunner {
   
       @Inject // or producer is null
       @Produce("direct:runner")
       ProducerTemplate producer;
   
       public void run() {
           try {
               producer.sendBody("test");
   
               Quarkus.waitForExit();
           } catch (Exception ex) {
               ex.printStackTrace();
           }
       }
   
   }
   
   @ApplicationScoped
   public class CamelRoutes extends RouteBuilder {
   
       @Override
       public void configure() {
           from("direct:runner")
                   .log("${body}");
   
           from("timer://foo-timer?fixedRate=true&period=5000")
                   .setBody(constant("foo-test"))
                   .to("reactive-streams:foo-notification1");
   
           from("reactive-streams:foo-notification2")
                   .to("direct:foo-notification2");
   
           from("direct:foo-notification2")
                   .to("direct:foo-notification3"); // does not call Bar#onBar
   
   //        from("direct:foo-notification2")
   //                .bean(Bar.class, "onBar"); // works fine
       }
   }
   
   public class Bar {
   
       @Consume("direct:foo-notification3")
       public void onBar(String str) {
           System.out.println("Bar#onBar: " + str);
       }
   }
   
   @ApplicationScoped
   public class Foo {
   
       @Inject
       CamelContext context;
   
       Subscriber<String> subscriber;
   
       @PostConstruct
       public void init() {
           subscriber = CamelReactiveStreams.get(context)
               .streamSubscriber("foo-notification2", String.class);
       }
   
       @Incoming("foo-mutiny-notification")
       public void consume(String notify) {
           subscriber.onNext(notify);
       }
   
       @Outgoing("foo-mutiny-notification")
       public Publisher<String> consume() {
           var camel = CamelReactiveStreams.get(context);
           return camel.fromStream("foo-notification1", String.class);
       }
   }
   ```
   
   ```
   application.properties
   
   quarkus.banner.enabled=false
   quarkus.package.main-class=foo.bar.Main
   
   pom.xml
   
   <?xml version="1.0"?>
   <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <modelVersion>4.0.0</modelVersion>
       <groupId>foo.bar</groupId>
       <artifactId>command-mode</artifactId>
       <version>1.0.0-SNAPSHOT</version>
       <dependencyManagement>
           <dependencies>
               <dependency>
                   <groupId>io.quarkus</groupId>
                   <artifactId>quarkus-universe-bom</artifactId>
                   <version>1.13.4.Final</version>
                   <type>pom</type>
                   <scope>import</scope>
               </dependency>
           </dependencies>
       </dependencyManagement>
       <dependencies>
           <dependency>
               <groupId>io.quarkus</groupId>
               <artifactId>quarkus-picocli</artifactId>
           </dependency> 
           <dependency>
               <groupId>io.quarkus</groupId>
               <artifactId>quarkus-smallrye-reactive-messaging</artifactId>
           </dependency>                   
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-direct</artifactId>
               <version>1.9.0-SNAPSHOT</version>            
           </dependency>              
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-bean</artifactId>
               <version>1.9.0-SNAPSHOT</version>
           </dependency>  
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-timer</artifactId>          
               <version>1.9.0-SNAPSHOT</version>
           </dependency>   
           <dependency>
               <groupId>org.apache.camel.quarkus</groupId>
               <artifactId>camel-quarkus-reactive-streams</artifactId>          
               <version>1.9.0-SNAPSHOT</version>
           </dependency>  
       </dependencies>               
       <build>
           <plugins>
               <plugin>
                   <groupId>io.quarkus</groupId>
                   <artifactId>quarkus-maven-plugin</artifactId>
                   <version>1.13.4.Final</version>
                   <extensions>true</extensions>
                   <executions>
                       <execution>
                           <goals>
                               <goal>build</goal>
                               <goal>generate-code</goal>
                               <goal>generate-code-tests</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
               <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-compiler-plugin</artifactId>
                   <version>3.8.1</version>
               </plugin>                       
           </plugins>
       </build>
       <properties>
           <maven.compiler.source>11</maven.compiler.source>
           <maven.compiler.target>11</maven.compiler.target>
       </properties>
   </project>
   
   ```


-- 
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] KMUS commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
KMUS commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-848795124


   @ppalaga 
   
   see comments in project
   
   [sample.zip](https://github.com/apache/camel-quarkus/files/6547198/sample.zip)
   


-- 
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] KMUS commented on issue #2632: No consumers available on endpoint

Posted by GitBox <gi...@apache.org>.
KMUS commented on issue #2632:
URL: https://github.com/apache/camel-quarkus/issues/2632#issuecomment-845254233


   Version 1.9.0 built and included
   
   >        <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-direct</artifactId>
   >             <version>1.9.0-SNAPSHOT</version>            
   >         </dependency>              
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-bean</artifactId>
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-file</artifactId>
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-kafka</artifactId>           
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-timer</artifactId>          
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-rabbitmq</artifactId>          
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>  
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-reactive-streams</artifactId>          
   >             <version>1.9.0-SNAPSHOT</version>   
   >         </dependency>                 
   >         <dependency>
   >             <groupId>org.apache.camel.quarkus</groupId>
   >             <artifactId>camel-quarkus-log</artifactId>   
   >             <version>1.9.0-SNAPSHOT</version>                     
   >         </dependency>
   
   1.) The new version seems to fix that issue 'No consumers available on endpoint' but still result in a npe. Injection works fine with @Inject on @Produce. According to the docs, it should work without inject too.
   ```
   @Dependent
   public class CamelRunner {
   
       @Produce("direct:runner")
       ProducerTemplate producer;
   ```
   ```
   java.lang.NullPointerException
   	at x.y.CamelRunner.run(CamelRunner.java:38)
   	at x.y.CamelRunner_Subclass.run$$superaccessor1(CamelRunner_Subclass.zig:189)
   	at x.y.CamelRunner_Subclass$$function$$1.apply(CamelRunner_Subclass$$function$$1.zig:29)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.CamelRunner_Subclass.run(CamelRunner_Subclass.zig:147)
   	at x.y.Main.run(Main.java:25)
   	at x.y.Main_Subclass.run$$superaccessor2(Main_Subclass.zig:327)
   	at x.y.Main_Subclass$$function$$2.apply(Main_Subclass$$function$$2.zig:29)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.Main_Subclass.run(Main_Subclass.zig:285)
   	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
   	at picocli.CommandLine.access$1300(CommandLine.java:145)
   	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
   	at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
   	at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
   	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
   	at picocli.CommandLine.execute(CommandLine.java:2078)
   	at x.y.Main.run(Main.java:30)
   	at x.y.Main_Subclass.run$$superaccessor1(Main_Subclass.zig:220)
   	at x.y.Main_Subclass$$function$$1.apply(Main_Subclass$$function$$1.zig:33)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:63)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
   	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
   	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
   	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
   	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
   	at x.y.Main_Subclass.run(Main_Subclass.zig:181)
   	at x.y.Main_ClientProxy.run(Main_ClientProxy.zig:158)
   	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:122)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
   	at x.y.Main.main(Main.java:34)
   	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$3.run(StartupActionImpl.java:134)
   	at java.base/java.lang.Thread.run(Thread.java:834)
   ```
   
   2.) Unused bean is removed during build. Adding @Unremovable will not call onBar anymore.
   
   ```
   @ApplicationScoped
   public class Bar {
   
       @Consume("direct:bar")
       public void onBar(String str) {
       }
   }
   ```
   ```
   ================================================================================
   CDI: programmatic lookup problem detected
   -----------------------------------------
   At least one bean matched the required type and qualifiers but was marked as unused and removed during build
   Removed beans:
   	- CLASS bean x.y.Bar [types=[class x.y.Bar], qualifiers=[@javax.enterprise.inject.Default(), @javax.enterprise.inject.Any()]]
   Required type: class x.y.Bar
   Required qualifiers: []
   Solutions:
   	- Application developers can eliminate false positives via the @Unremovable annotation
   	- Extensions can eliminate false positives via build items, e.g. using the UnremovableBeanBuildItem
   	- See also https://quarkus.io/guides/cdi-reference#remove_unused_beans
   ================================================================================
   ```
   ```
   @ApplicationScoped
   @Unremovable
   public class Bar {
   
       @Consume("direct:bar")
       public void onBar(String str) {
       }
   }
   
   @ApplicationScoped
   public class MutinyTest {
   
       @Inject
       CamelContext context;
   
       Subscriber<String> subscriber;
   
       @PostConstruct
       public void init() {
           subscriber = CamelReactiveStreams.get(context)
               .subscriber("direct:foo-notification", String.class);
       }
   
       @Incoming("foo-notification") // mutiny
       public void consume(String notify) {
           subscriber.onNext(notify);
       }
   }
   
   from("direct:foo-notification").to("direct:bar");
   ```


-- 
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