To 2., yes the route(Object) indeed needs to provide additional methods it currently does not provide.
Since an EventSender can send custom event representations, the additional route methods would be:
route(Map map, String eventTypeAlias)
route(Node node)
EventSender getRouteEventSender(String eventTypeAlias)
EventSender getRouteEventSender(URI[] uris)
I have created a JIRA for this request: http://jira.codehaus.org/browse/ESPER-277
There is currently no workaround for routing Maps, other then using
sendEvent.
If the sendEvent does encounter a loop in the case that you are using different threads then that would seem to threads being consumed; Also Esper provides configurable guaranteed order of delivery blocking the thread before the dispatch, if required.
Best regards,
Tom
----- Original Message ----
From: Anshul Jaiswal <
anshul@...>
To:
user@...Sent: Friday, August 22, 2008 3:26:34 PM
Subject: [esper-user] question on EPRuntime.route()
Folks,
I had some questions on the EPRuntime.route().
- Would it be fair to say that you'd want to use route() instead of sendEvent() to send events from within an UpdateListener or Subscriber to avoid the possibility of a stack overflow due to nested calls to sendEvent?
- The route() API is not symmetric with the
sendEvent() API, ie. there's no way to route Maps or XML events. Looking at the EPRuntimeImpl code, it appears any data, sent via route(), that is not an EventBean, is interpreted as a POJO event. Is there any easy way to route a map with an event type alias. Seems like I can post an EventBean that wraps the map... is there an easy way to create an event bean for the map using the client API? Can I get a reference to EventAdapterService instance from the client API somehow?
- Is there any downside, if we workaround the above-mentioned issue by sending maps via a different thread that invokes sendEvent(), besides not having that event processed before the next event?
Thanks in advance!
Anshul