Skip navigation links
com.oracle.cep.cluster.ha.adapter
Class BroadcastQueueTrimmingAdapter
java.lang.Object
|
+--com.oracle.cep.cluster.ha.adapter.QueueTrimmingAdapter
|
+--com.oracle.cep.cluster.ha.adapter.BroadcastQueueTrimmingAdapter
- public class BroadcastQueueTrimmingAdapter
- extends QueueTrimmingAdapter
- implements Adapter, QueueTrimmingStrategy, RunnableBean
The BroadcastQueueTrimmingAdapter is intended for use by highly available CEP applications that need to guarantee that no output events are dropped when there is a failover, but which can tolerate duplicate output events. The BroadcastQueueTrimmingAdapter works by queuing output events at the secondary(s) until the primary acknowledges that the output event has been sent. The frequency of acknowledgment messages broadcast by the primary is configurable. The BroadcastQueueTrimmingAdapter can be used to create a soft upper bound on the number of duplicate messages. For example, if a trimming-interval of 1 event is specified, the primary will acknowledge every event that is sent and the number of duplicates sent by a secondary after the primary fails will be <= 1 (in the absence of a network failure). In order for the BroadcastQueueTrimmingAdapter to be used output events must have a unique key value that identifies them or they must have a monotonically increasing property, such as event time. The following static instance-properties are supported
keyProperties - name of event key property(s)
keyClass - Java class name of compound key class
eventType - event type name for the events processed by this adapter
(optional if using Java events)
monotonic - true if key property is monotonic (true by default)
totalOrder - true if monotonic values are unique (false by default)
The following dynamic properties are supported, however, a server restart/application redeployment is necessary for changes to take effect.
trimming-interval Specifies how often the primary sends trimming messages
to the secondary. Units are number of events (default) or
milliseconds ('events' or 'millis').
warm-up-window-length Specifies how long a server must warm-up after
joining the cluster before it is ready to be a
primary. Units can be seconds (default) or minutes.
The BroadcastInputAdapter is used by specifying the 'ha-broadcast' provider.
Fields inherited from class com.oracle.cep.cluster.ha.adapter.QueueTrimmingAdapter |
applicationIdentity, BECOMING_PRIMARY, BECOMING_SECONDARY, bundleContext, INITIALIZING, lock, log, PRIMARY, queue, queueLock, SECONDARY, stageIdentity, state, trimmingProtocol, trimmingStrategy, warmUpFinishTime, warmUpWindowMillis |
Methods inherited from class com.oracle.cep.cluster.ha.adapter.QueueTrimmingAdapter |
activateConfiguration, checkConfiguration, doInsert, getApplicationIdentity, getGroupName, getQueue, getStageIdentity, getState, getTrimmingProtocol, getWarmUpWindowMillis, isExactTrimming, isInitializing, isPrimary, isSecondary, onInsertEvent, rollbackConfiguration, setApplicationIdentity, setEventSender, setExactTrimming, setGroupName, setQueue, setStageIdentity, setTrimmingProtocol, setTrimmingStrategy, setWarmUpWindowMillis, stateChange |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BroadcastQueueTrimmingAdapter
public BroadcastQueueTrimmingAdapter()
setMonotonic
public void setMonotonic(boolean monotonic)
afterPropertiesSet
public void afterPropertiesSet()
-
- Overrides:
- afterPropertiesSet in class QueueTrimmingAdapter
setGroupBroadcast
public void setGroupBroadcast(GroupBroadcast groupBroadcast)
checkConfiguration
public void checkConfiguration(BroadcastQueueTrimmingAdapterConfig config)
-
- Overrides:
- checkConfiguration in class QueueTrimmingAdapter
activateConfiguration
public void activateConfiguration(BroadcastQueueTrimmingAdapterConfig config)
-
- Overrides:
- activateConfiguration in class QueueTrimmingAdapter
rollbackConfiguration
public void rollbackConfiguration(BroadcastQueueTrimmingAdapterConfig config)
-
- Overrides:
- rollbackConfiguration in class QueueTrimmingAdapter
afterConfigurationActive
public void afterConfigurationActive()
throws java.lang.Exception
-
- Overrides:
- afterConfigurationActive in class QueueTrimmingAdapter
run
public void run()
suspend
public void suspend()
throws java.lang.Exception
onMembershipChange
public void onMembershipChange(Server server,
Configuration configuration)
-
- Overrides:
- onMembershipChange in class QueueTrimmingAdapter
getLastReceivedKey
protected java.io.Serializable getLastReceivedKey()
-
- Overrides:
- getLastReceivedKey in class QueueTrimmingAdapter
onMessage
public void onMessage(java.lang.Object message)
onProcessedEvent
public void onProcessedEvent(java.lang.Object event)
-
- Specified by:
- onProcessedEvent in interface QueueTrimmingStrategy
onQueuedEvent
public void onQueuedEvent(TrimmableQueue queue)
-
- Specified by:
- onQueuedEvent in interface QueueTrimmingStrategy
getLastReceivedMessage
public com.oracle.cep.cluster.ha.message.QueueTrimmingMessage getLastReceivedMessage()
getSentMessageCount
public long getSentMessageCount()
getReceivedMessageCount
public long getReceivedMessageCount()
getTrimCount
public int getTrimCount()
setTotalOrder
public void setTotalOrder(boolean totalOrder)
setKeyProperties
public void setKeyProperties(java.lang.String keyProperties)
setKeyClass
public void setKeyClass(java.lang.Class keyClass)
getEventTrimmingInterval
public long getEventTrimmingInterval()
setEventTrimmingInterval
public void setEventTrimmingInterval(long eventTrimmingInterval)
getMillisTrimmingInterval
public long getMillisTrimmingInterval()
setMillisTrimmingInterval
public void setMillisTrimmingInterval(long millisTrimmingInterval)
getLastSentMessage
public com.oracle.cep.cluster.ha.message.QueueTrimmingMessage getLastSentMessage()
getOutOfOrderCount
public long getOutOfOrderCount()
getEventTypeRepository
public EventTypeRepository getEventTypeRepository()
setEventTypeRepository
public void setEventTypeRepository(EventTypeRepository eventTypeRepository)
getEventType
public java.lang.String getEventType()
setEventType
public void setEventType(java.lang.String eventType)
setBundleContext
public void setBundleContext(BundleContext bundleContext)
-
- Overrides:
- setBundleContext in class QueueTrimmingAdapter