0

The smallrye documentation (from https://smallrye.io/smallrye-reactive-messaging/) cites an example code snippet that I'm having trouble compiling...

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 CamelReactiveStreamsService camel_reactive;

[...]

@Incoming("camel")
public Subscriber<String> sink() {
  return camel.subscriber("file:./target?fileName=values.txt&fileExist=append", String.class);
}

--It seems as if the "camel" object - i.e., as in, "camel.subscriber" (above) - does not have a "subscriber" method associated with it(?).

The compile error looks like this...

cannot find symbol
  symbol:   method subscriber(java.lang.String,java.lang.Class<java.lang.String>)
  location: variable camel of type org.apache.camel.CamelContext

I've included the following dependencies in my Maven pom.xml ( initially just the first one - and then added the 2nd in a desperate attempt to get this example snippet to work - tried version 1.0.8, as well)

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

Was hoping someone knowledgeable in camel and/or smallrye reactive messaging discern the issue that causes the compile error?

Thx!

sairn
  • 461
  • 3
  • 24
  • 58

1 Answers1

1

Well, as a newby to smallrye, etc., I fell victim to taking the documentation word-for-word. But, it seems that "camel.subscriber" was an editing mistake in the documentation. Should have been written: "camel_reactive.subscriber".

Compiles find now.

sairn
  • 461
  • 3
  • 24
  • 58
  • Thanks for finding the solution. I have proposed a fix in the doc with this PR: https://github.com/smallrye/smallrye-reactive-messaging/pull/321 – Claus Ibsen Nov 19 '19 at 04:20