I am trying to build a route using Java DSL and I'm getting a confusing error
in my IDE (IntelliJ). Here's what I'm trying to do:
1. Receive a message from a JMS Queue
2. Enrich the message by querying a database to retrieve additional content
(claim check pattern)
3. Filter the messages to exclude any 'test' messages
4. Print to the console
Here's my Java DSL:
public class MyRouteBuilder extends RouteBuilder {
public void configure() throws Exception {
from("jms:xmlOrders")
.bean(enricher, "enrichData")
.filter().xpath("/order[not(@test)]")
.to("stream:out"); // ERROR on this line in IDE
}
}
The IDE highlights the last line (.to("stream:out");) as an error and I'm
having a hard time understanding why. If I remove the bean doing the
enrichment it works fine. ie:
from("jms:xmlOrders")
//.bean(enricher, "enrichData") COMMENTED OUT
.filter().xpath("/order[not(@test)]")
.to("stream:out"); // NOW everything is fine
I also tried replacing the bean with a new Processor that does the same
thing in case the issue has to do with keeping the Exchange in tact but it
still didn't make the error go away.
I'm sure this is how it's supposed to work and is due to a lack of my
understanding. I would be grateful if anyone could help me understand why
this is happening!
--
View this message in context:
http://camel.465427.n5.nabble.com/Help-with-filter-behavior-tp2256745p2256745.html
Sent from the Camel - Users mailing list archive at Nabble.com.