Package Exports
- ibm-iis-kafka
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ibm-iis-kafka) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
README
ibm-iis-kafka
Re-usable functions for interacting with IBM InfoSphere Information Server's Kafka event mechanism
Examples
const iiskafka = require('ibm-iis-kafka');
const infosphereEventEmitter = new iiskafka.InfosphereEventEmitter('zookeeper-host:2181', 'asset-object-handler', false);
infosphereEventEmitter.on('IGC_DATABASESGROUP_EVENT', function(infosphereEvent, eventCtx, commitCallback) {
console.log("Processing a change to a Database object:");
console.log(" ... type (display name): " + infosphereEvent.ASSET_TYPE);
console.log(" ... unique ID (RID) : " + infosphereEvent.ASSET_RID);
console.log(" ... parent identity : " + infosphereEvent.ASSET_CONTEXT);
console.log(" ... asset identity : " + infosphereEvent.ASSET_NAME);
console.log(" ... action taken : " + infosphereEvent.ACTION);
console.log("Full event: " + JSON.stringify(infosphereEvent));
commitCallback(eventCtx); // tell Kafka we've successfully consumed this event
});
Meta
- license: Apache-2.0
InfosphereEventEmitter
Connects to Kafka on the specified system and emits any events raised, based on the specified parameter
Parameters
zookeeperConnection
string the hostname of the domain (services) tier of the Information Server environment and port number to connect to Zookeeper service (e.g. hostname:52181)handlerId
string a unique identity for the handler (allowing multiple handlers to consume the same events)bFromBeginning
boolean? if true, process all events from the beginning of tracking in Information Servertopic
string? name of the topic for which to emit events (optional, default'InfosphereEvents'
)
eventCommitCallback
This callback is invoked as in order to commit that an event was successfully consumed from Kafka
Type: Function
Parameters
eventCtx
Object the context of the Kafka event that was consumed