I haven't been able to find any examples that help me understand what I need to do here, so I'll explain my problem:
I have a Java Bean that implements a custom listener for Pivotal's Gemfire product. It implements an interface known as CqListener, which defines a method as follows:
public void onEvent(CQEvent evt){
...
}
Basically, when we execute a Continuous Query (CQ) on the Gemfire grid, we register this Bean as a Listener that will receive any change in the grid that matches our query.
For example, executing a CQ like
SELECT * FROM /table_name
will give us a CQEvent
in the onEvent
method whenever anything in the 'table_name' table (in Gemfire it's called a region though) changes (CRUD)
What I am now trying to do is wire up Camel to route anything from this underlying CQ stuff to a custom route. Is there anyway I can tell Camel to say "Hey, anytime a call is made to onEvent, take that and route it somewhere else" ?
The somewhere else I am trying to route to is an Akka Actor. There already is a project that wraps akka and camel (http://doc.akka.io/docs/akka/snapshot/scala/camel.html) but I can't figure out this Endpoint URI business to get the inbound CQ events.
I know I am missing a conceptual key regarding Camel, so any help is greatly appreciated. I have managed to implement this using a jms endpoint, so I get how it works for the well known protocols, but I'm just trying to figure out how to do this for custom protocols where the implementation is abstracted away from me (As is the case of CQListener)