Besides using a cache for contextual data, another good use is to use it as the supplier of input data or as the final event sink for processed results.
The Oracle Coherence cache has a simple way for you to listen for changes that occur. By implementing a Map Listener interface, you can receive data into your OEP application and then connect a channel so that it acts similar to how an input adapter would.
At the end of an EPN, you could use a cache as the result sink. This provides a low latency way to output your events.
First, let's look at using the cache in place of an input adapter to supply events to your application as an event source. You need to set up the caching system as described at the beginning of this chapter, but you will make one important addition to the configuration. You will use <wlevs:cache-listener>
to set up an event-bean class that implements MapListener
and StreamSource
, which can listen for changes in the cache and forward...