NME Event Handler

In this section:

This section describes the NME Event Handler.


Top of page

x
Configuration File

The configuration file of event handlers is a list of all event handlers that are to be used.

<?xml version="1.0" encoding="utf-8"?>
<handlers>
	<handler class="first.desired.handler.Class">
		... handler configuration ...
	</handler>
	<handler class="second.desired.handler.Class">
		... handler configuration ...
	</handler>
	...
</handlers>

Top of page

x
Asynchronous Event Handler

Asynchronous event handler; during NME operation it stores all necessary data to a specified directory. Only when the NME operation is completed, it initiates publishing of the data. If publishing of an event fails for any publisher, the publishing is stopped. When resumed, the event at which the failure occurred is published again with all publishers (that means some publishers may have distributed it two or more times). The preceding events are not published again.

<handler class="com.ataccama.nme.engine.event.handler.EventHandlerAsync">
	<persistenceDir>/persistence/directory</persistenceDir>
	<filter>
		...
	</filter>
	<publishers>
		<publisher class="first.desired.publisher.Class">
			... publisher configuration ...
		</publisher>
		<publisher class="second.desired.publisher.Class">
			... publisher configuration ...
		</publisher>
		...
	</publishers>
</handler>

where:

persistenceDir

Is the path to a directory where all the persisted data will be stored (temporarily, before they are published). This directory should not be used to store anything else and must not be shared by multiple event handlers.

filter

Can pre-select events that will be persisted (and, consequently, published).

publishers

Is the list of all publishers which will distribute the data into various systems, depending on their nature and configuration.


Top of page

x
Filters

Filter is an element that allows pre-filtering the events so only certain events are actually accepted.

<filter>
	<filterExpression>meta.event_type = "UPDATE"</filterExpression>
	<entities>
		<entity name="party" layer="instance">
			<filterExpression>new.src_name != old.src_name</filterExpression>
		</entity>
		<entity name="party" layer="master" masterView="MasterView" />
	</entities>
</filter>

where:

filterExpression

Is a boolean iWay DQS expression that can be specified here. In that case, only the events for which the expression evaluates to true are accepted. It can be omitted to accept all events. Only metadata columns are available here.

entities

Is the second filtering tool that allows you to specify entities only from which the events will be accepted (all other events of entities will be filtered out). Each entity is identified by its name and layer (instance/master). For master entities (and only for master entities), they can be identified by its masterView. This has to be an existing entity that has not been already filtered out earlier (usually by a filter on the parent element). Each entity can have its own filterExpression that works exactly like the filterExpression on the filter, except all the data columns are available (old and new values of the changed records as well as metadata columns).


Top of page

x
Delegating Publishers

The delegating publisher can be used wherever a publisher is expected, but not doing the actual publishing. Instead, it is adding another kind of functionality, and for the publishing itself, using another publisher (delegate). This delegate can also be a delegating publisher, cascading this event handling chain one level further.

Filtering Publisher

Adds the possibility to filter the flow of incoming events to the underlying publisher.

<publisher class="com.ataccama.nme.engine.event.handler.publishers.
FilteringPublisher">
	<filter>
		...
	</filter>
	<delegate class="delegate.publisher.Class">
		...
	</delegate>
</publisher>

where:

filter

Is a filter.

delegate

Is another publisher that will be used for the actual publishing of the events that pass through the specified filter (this publisher can also be another delegating publisher).

Retrying Publisher

The Retrying Publisher adds the possibility to retry a failed attempt to publish an event. Each time a publishing of an event fails, one global retry is consumed to retry the publishing of this event after the specified retry delay. If there are no global retries left, the publishing fails like it would without this Retrying Publisher. Additionally, after the specified amount of consecutive publishing attempts that were all successful, one additional global retry is generated. This way, the reserve of global retries can grow (up to the specified maximum amount of retries) to be used later.

<publisher class="com.ataccama.nme.engine.event.handler.publishers.
RetryingPublisher">
	<globalRetries>5</globalRetries>
	<retryDelay>20</retryDelay>
<numberOfConsecutiveSuccessesGrantingRetry>10
</numberOfConsecutiveSuccessesGrantingRetry>
	<maximumRetries>30</maximumRetries>
	<delegate class="delegate.publisher.Class">
		...
	</delegate>
</publisher>

where:

globalRetries

Is the initial amount of retries.

retryDelay

Is the delay after a failed attempt to publish an event before retry (in seconds).

numberOfConsecutiveSuccessesGrantingRetry

Is the amount of consecutive successes that will generate another retry. 0 means no retries will be generated.

maximumRetries

Is the limit of retries in reserve.


Top of page

x
Publishers

Publishers do the actual publishing, and send the events in the way specified by their nature and configuration.

The following list describes the publishers.


Top of page

x
Transformers

A transformer is an element that transforms an event into a string, which is a message that will be distributed by a publisher.

The following list describes the different Transformer types.


Top of page

x
Templates

A template is an attribute type. It is basically a string type, but allows nested iWay DQS expressions that give you all the tools and expressive power of the iWay DQS engine. Expressions are denoted by ${ ... } notation by default.

<template>
	<entity name="party" layer="master" masterView="MasterView" />
	<template>This is a common string and ${'this will be evaluated as DQS
expression'}</template>
</template>

where:

entity

Specifies the entity this template applies to. You can use all the entity specific data columns in the expressions of the template.

template

Is the text template itself, with nested iWay DQS expressions. Since the expressions are part of a string, they have to be of a STRING type. This includes converting any columns of a non-string type to string (by toString() iWay DQS function) if necessary.


Top of page

x
Evaluation of iWay DQS Expressions

There are two types of iWay DQS expressions in event handling: general and entity specific.



x
Non-functional Features

EventHandler stores events in persistent storage to deliver at-least-once semantics. Such an approach requires disk space (this should be taken into account for disk sizing) that can be computed as follows:

required_disk_space = event_size x event_count.


iWay Software