smallrye 文档(来自 https://smallrye.io/smallrye-reactive-messaging/)引用了一个我在编译时遇到问题的示例代码片段......
IE,
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);
}
——似乎“camel”对象——例如,“camel.subscriber”(上图)——没有与之关联的“subscriber”方法(?)。
编译错误看起来像这样......
cannot find symbol
symbol: method subscriber(java.lang.String,java.lang.Class<java.lang.String>)
location: variable camel of type org.apache.camel.CamelContext
我在我的 Maven pom.xml 中包含了以下依赖项(最初只是第一个 - 然后添加了第二个以拼命尝试让这个示例片段正常工作 - 也尝试了 1.0.8 版)
<!-- 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>
希望熟悉骆驼和/或 smallrye 响应式消息传递的人能够识别导致编译错误的问题吗?
谢谢!