@citrineos/util
Version:
The OCPP util module which supplies helpful utilities like cache and queue connectors, etc.
29 lines (28 loc) • 916 B
TypeScript
import { AbstractMessageHandler, CallAction, IMessageHandler, IModule, SystemConfig } from '@citrineos/base';
import { ILogObj, Logger } from 'tslog';
/**
* Implementation of a {@link IMessageHandler} using Kafka as the underlying transport.
*/
export declare class KafkaReceiver extends AbstractMessageHandler implements IMessageHandler {
/**
* Fields
*/
private _client;
private _topicName;
private _consumerMap;
constructor(config: SystemConfig, logger?: Logger<ILogObj>, module?: IModule);
subscribe(identifier: string, actions?: CallAction[], filter?: {
[k: string]: string;
}): Promise<boolean>;
unsubscribe(identifier: string): Promise<boolean>;
shutdown(): Promise<void>;
/**
* Private Methods
*/
/**
* Underlying Kafka message handler.
*
* @param message The kafka message to process
*/
private _onMessage;
}