question on EPRuntime.route()

View: New views
3 Messages — Rating Filter:   Alert me  

question on EPRuntime.route()

by Anshul Jaiswal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Folks,

I had some questions on the EPRuntime.route().

  1. 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?
  2. 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?
  3. 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

Parent Message unknown Re: question on EPRuntime.route()

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Anshul,

yes your statement towards route() in 1. is correct and the documentation is getting updated to add the additional description.
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().

  1. 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?
  2. 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?
  3. 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


Re: question on EPRuntime.route()

by Anshul Jaiswal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the clarifications and filing the JIRA issue, Tom!

On Sat, Aug 23, 2008 at 3:58 AM, Thomas Bernhardt <bernhardttom@...> wrote:
Hi Anshul,

yes your statement towards route() in 1. is correct and the documentation is getting updated to add the additional description.
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().

  1. 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?
  2. 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?
  3. 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


LightInTheBox - Buy quality products at wholesale price!