camel-idea-plugin icon indicating copy to clipboard operation
camel-idea-plugin copied to clipboard

CDI injected processor classes are not resolved as beans

Open sivakuna-aap opened this issue 5 years ago • 4 comments

Camel Version: 3.7.0 Intellij Version: 2021.1

@javax.inject.Named
class MyProcessor implements Processor {
}

@javax.inject.Named
class MyRouteBuilder extends RouteBuilder {
  public void configure() throws Exception {
    from("direct:myUri")
       .process("myProcessor")
       .end();
  }
}

Intellij does not resolve myProcessor as an injected bean. It works when I annotate with Spring Component

sivakuna-aap avatar Apr 15 '21 14:04 sivakuna-aap

There is a new 0.7.x plugin that is Camel 3 based, can you try with that

davsclaus avatar May 01 '21 10:05 davsclaus

I tried the version 0.7.2 plugin and it does not fix the issue.

sivakuna-aap avatar May 01 '21 12:05 sivakuna-aap

When you say Intellij do you mean that the Camel IDEA plugin should have done something or do you mean IDEA in general working with CDI?

I dont think we have jump to CDI beans as part of the IDEA plugin.

There is only special support when using beans EIP, eg

.bean(MyFooClass.class, "doSomething")

davsclaus avatar May 02 '21 08:05 davsclaus

This should be part of the Camel IDEA plugin because invoking processors using processor names as a reference is specific to Camel.

When the Plugin can resolve a Camel processor which is a Spring component, why it cannot resolve a Named processor?

Having said that, the latest version of the plugin behaves the same for both Spring component processors and Named processors.

sivakuna-aap avatar May 02 '21 13:05 sivakuna-aap

@ammachado you are welcome to look at this too

davsclaus avatar Oct 22 '23 12:10 davsclaus

@davsclaus I wasn't aware of this issue, but I think that #947 fixes it.

ammachado avatar Oct 22 '23 13:10 ammachado

okay 1.1.4 is released, try with that version

davsclaus avatar Oct 22 '23 14:10 davsclaus