I'm new in Camel technology and I'm using ProducerTemplate to send object to the queue. I have defined RouteBuilder object and I'm using filter in route deffinition. My question is what should I use to give feedback message when filter would return false and don't let my message go to the queue. How can I get notification from templateProducer that my message was invalid?
Example pseudo code:
@Produce
ProducerTemplate template;
class Route extends RouteBuilder
{
...
public void configure() throws Exception
{
from("direct:start")
.filter(...)
.to("direct:myQueue");
}
...
}
template.sendBodyAndHeaders(new Route(), myBody, myHeaders);