Class AbstractMessageTranslator

AbstractMessageTranslator class

Description

Abstract class to be extended by message translators

Example

class StringMessageTranslator extends AbstractMessageTranslator {
translate(message: string): object {
logging.debug('Translating message to string');
return {
content: message,
metadata: {}
};
}

Hierarchy

Constructors

Methods

Constructors

Methods

  • Translate a given message to an appropriate format to message processing This method should return a object instance with two keys: content and metadata. The content should contain the translated message and, metadata a object with translation metadata or an empty json object.

    Returns

    • Translated message

    Memberof

    AbstractMessageTranslator

    Parameters

    • message: any

      Message to be translated

    • Rest ...args: any

      Additional arguments to be used by the translator

    Returns MessageTranslatorOutput