Java Can';t确定smallrye/camel代码段未编译的原因:camel上下文obj中没有订户方法?
smallrye文档(来自)引用了一个我在编译时遇到问题的示例代码段 i、 eJava Can';t确定smallrye/camel代码段未编译的原因:camel上下文obj中没有订户方法?,java,apache-camel,maven-3,smallrye-reactive-messaging,Java,Apache Camel,Maven 3,Smallrye Reactive Messaging,smallrye文档(来自)引用了一个我在编译时遇到问题的示例代码段 i、 e 10.4. Using Camel Route in @Incoming method Here is an example of method annotated with @Incoming directly using a Camel route: [...] @Inject private CamelContext camel; <<== @Inject private CamelReac
10.4. Using Camel Route in @Incoming method
Here is an example of method annotated with @Incoming directly using a Camel route:
[...]
@Inject
private CamelContext camel; <<==
@Inject
private CamelReactiveStreamsService camel_reactive;
[...]
@Incoming("camel")
public Subscriber<String> sink() {
return camel.subscriber("file:./target?fileName=values.txt&fileExist=append", String.class);
}
10.4。在@Incoming方法中使用驼峰路由
下面是一个使用驼峰路由直接使用@Incoming注释的方法示例:
[...]
@注入
私人骆驼 作为smallrye等公司的新手,我成了逐字逐句理解文档的牺牲品。
但是,“camel.subscriber”似乎是文档中的一个编辑错误。
应该写上:“camel_reactive.subscriber”
编译“立即查找”。感谢您找到解决方案。我已在该PR的文档中提出了一个修复方案:
cannot find symbol
symbol: method subscriber(java.lang.String,java.lang.Class<java.lang.String>)
location: variable camel of type org.apache.camel.CamelContext
<!-- camel support -->
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-reactive-messaging-camel</artifactId>
<version>1.0.7</version>
</dependency>
<!-- ampq -->
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-reactive-messaging-amqp</artifactId>
<version>1.0.7</version>
</dependency>